Replies: 1 comment 3 replies
-
Sorry, I'm not following. What are you trying to solve, and where is the problem in the posted code 😅 ? |
Beta Was this translation helpful? Give feedback.
3 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 was wondering, if there is any other way to pass parameters to query functions, than the
queryKey
. I'm currently using a pattern where I write a custom-hook to my queries, which makes it super easy to consume a query in a components. Within my query-functions I'm using an axios-instance, which is handled by a context (calledApiContext
). So in my custom-hook I'm getting this instance from the context, but how can I pass this to the function? If I put this in thequeryKey
this axios instance will end up in the cache-key - that's not what I would like.This is my current implementation for a generic hook:
And I use it like this:
Beta Was this translation helpful? Give feedback.
All reactions