How to add params to queryKey when using createQuery #7734
Unanswered
iamhaaamed
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Create a new function to wrap the query. export const useRequest = (id: string) => createQuery<Response, Variables, AxiosError>({
queryKey: ['requests', id],
queryFn() {
const response = await client.get(`request-garage/${id}`);
return response.data;
},
}); |
Beta Was this translation helpful? Give feedback.
1 reply
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a query like this:
I want to know how can I add params to the queryKey like this:
queryKey: ['requests', **id**]
Beta Was this translation helpful? Give feedback.
All reactions