How do I skip queries when using convex with tanstack query.
I am passing a conditional boardId but only want the query to run if and only if the boardId is present.
I have tried all these but none of them work:
Thank you in advance
6 Replies
What does not work::: does it send the request, or does not?
you can try to set the enabled variable to TRUE or FALSE and see if that works.
Enabled isn't supported yet, this is coming soon! https://github.com/get-convex/convex-react-query/issues/5
GitHub
Dependent queries are not working with tanstack query · Issue #5 · ...
Convex query is executed even if the enabled condition is not met. const { fetchStatus, data: ordersResponse, isError, isPending: isOrderPending, isSuccess } = useQuery({ ...convexQuery(api.orders....
@Olamide for anything else you run into feel free to raise here but issues on this repo are also good.
It sends the request even when the enabled is false. I tested the enabled flag works on other queries apart from convex queries and they worked fine
Oh alright. Thank you. I will look out for that
You can also use this method if you want to query conditional
@jamalsoueidan Thank you