GraphQL subscription in tanstack query #6258
Unanswered
trishagonzales
asked this question in
Q&A
Replies: 1 comment
-
not sure what that means. have you read: https://tkdodo.eu/blog/using-web-sockets-with-react-query if you have no resource to query, meaning no endpoint to make the initial fetch from, don't use react-query - just setup the subscription and push data somewhere else :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm new to react query and I'm trying to implement graphql subscription. There are examples and guides both in tanstack and the-guild.dev docs about graphql queries and mutations in react query but nothing for subscription.
I tried to connect sockets on useEffect and call setQueryData when receiving new updates but setQueryData needs a query key and a query key needs an observer. Is a query observer necessary when data is always updated directly in cache? If so, what do i put in queryFn?
Beta Was this translation helpful? Give feedback.
All reactions