query context #2286
Unanswered
correttojs
asked this question in
Ideas
query context
#2286
Replies: 1 comment
-
could you elaborate why the default query function is not flexible enough? I don't fully understand the use case yet |
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 writing a gql client based on fetch and react-query.
I was considering an example with multiple gql client instances, each of them linked to a different endpoint.
It would be nice to expose a
context
to share some custom data between the react-queryQueryClient
and thequeryFn
(so extending the QueryFunctionContext) andmutationFn
. This way, in the above use case, I could define a default endpoint in the scope of the default react query client, and customize it in case I want to access a different endpoint.The
queryFn
already works in a similar way, as it can define a default implementation and override it on eachuseQuery
, though it doesn't seem to be flexible enough for my use caseBeta Was this translation helpful? Give feedback.
All reactions