The query argument is unknown! Please regenerate the types. #9678
Unanswered
kaliaparijat
asked this question in
Q&A
Replies: 1 comment
-
I ran into this issue this morning.
A useful tip for debugging is to set Cheers! |
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
-
Hello, I am trying to leverage GraphQL code-gen for my React application (typescript, apollo). This is what the config object looks like in my codegen file:
This generates the anticipated files including the gql file. There are 14 queries in total, and thus the gql file has 14 overloads for the generated graphql function. However, the very first graphql function definition looks like this:
As the comment indicates, the original has a type unknown. I am not able to use this, because Apollo's useQuery hooks complain about a type mismatch and suggest:
Argument of type 'unknown' is not assignable to parameter of type 'DocumentNode | TypedDocumentNode<any, {...queryVariables }>'..
What am I doing wrong here? An arbitrary example of how my queries have been written is listed below:
Beta Was this translation helpful? Give feedback.
All reactions