T
TanStack4y ago
yelping-magenta

Dependent Queries

Are there any good examples out there of dependent queries in solid? Mostly confused about the process of setting the enabled option correctly.
5 Replies
stormy-gold
stormy-gold4y ago
Hello! Yeah we plan to roll out more detailed documentation for solid query soon. But here is a small example
stormy-gold
stormy-gold4y ago
In this example, second query will only be enabled when first query is a success and first.data is defined
stormy-gold
stormy-gold4y ago
We are using the object getter syntax here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get to make the enabled property reactive to changes
getter - JavaScript | MDN
The get syntax binds an object property to a function that will be called when that property is looked up.
yelping-magenta
yelping-magentaOP4y ago
Awesome, thanks

Did you find this page helpful?