T
TanStack3y ago
rare-sapphire

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
deep-jade
deep-jade3y ago
Hello! Yeah we plan to roll out more detailed documentation for solid query soon. But here is a small example
deep-jade
deep-jade3y ago
In this example, second query will only be enabled when first query is a success and first.data is defined
deep-jade
deep-jade3y 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.
rare-sapphire
rare-sapphireOP3y ago
Awesome, thanks

Did you find this page helpful?