You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The helper found below, has been used in the docs to use graphql-codegen together with @tanstack/query. (preset: client)
However, the helper does not seem to play nice when trying to add options to the function signature (of type UseQueryOptions) and gives a type error when doing this.
I am happy to update the documentation afterwards, since I think this is used quite commonly.
In addition to this, I think the documentation should also provide examples for useSuspenseQuery and useInfiniteQuery.
This is the slightly modified helper, using a graphql-request client:
But this results in the following error on the second parameter of request()
Argument of type '{} | undefined' is not assignable to parameter of type 'Variables | undefined'.
Type '{}' is not assignable to type 'Variables'.
Index signature for type 'string' is missing in type '{}'.ts(2345)
Is your feature request related to a problem? Please describe.
No response
The text was updated successfully, but these errors were encountered:
robinclaes
changed the title
How can we add UseQueryOptions to the useQuery helper
How can we add options to the useQuery helper with the client preset?
Feb 7, 2024
Is your feature request related to a problem? Please describe.
The helper found below, has been used in the docs to use graphql-codegen together with @tanstack/query. (preset: client)
However, the helper does not seem to play nice when trying to add options to the function signature (of type
UseQueryOptions
) and gives a type error when doing this.I am happy to update the documentation afterwards, since I think this is used quite commonly.
In addition to this, I think the documentation should also provide examples for
useSuspenseQuery
anduseInfiniteQuery
.This is the slightly modified helper, using a
graphql-request
client:I've tried to achieve adding options with the following snippet:
But this results in the following error on the second parameter of
request()
codegen.ts
Describe the solution you'd like
Adding more examples to the docs.
Describe alternatives you've considered
No response
Is your feature request related to a problem? Please describe.
No response
The text was updated successfully, but these errors were encountered: