Skip to content
Discussion options

You must be logged in to vote

is there any pattern how to provide headers.

this depends on how you actually fetch the data and is out of hands of react-query. react-query is a Promise based library that only cares about resolved or rejected promises. They don't have to come from the network, so if you fetch data, that is entirely up to you :)

I must first pull data out with getQueryData and then push that data inside cache with setQueryData. Is this right?

no, prefetchQuery will put the result in the cache, that is what this method is for.

so changing from queryClient.prefetchQuery(key, () => fetcher); to queryClient.prefetchQuery(key, fetcher); solved problem above.

that just depends on what fetcher is doing. A…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nenadfilipovic
Comment options

Answer selected by nenadfilipovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants