Skip to content

Using urql with typescript #2157

Answered by JoviDeCroock
yassinm asked this question in Q&A
Discussion options

You must be logged in to vote

The stuff you're linking seems to be related to network requests which doesn't have much correlation with Typescript itself.

Using gql-code-generatoe is fully supported with the urql presets.

If some interpolation isn't working feel free to link us a code-example of how it goes wrong. Generally when we have an $id in the query and variables has a key with id and some value it will be filled in by your back-end.

We have a few examples in this repo in with-react, which show working examples, the addition with TypeScript is leveraging generics to have knowledge about the return type of the useQuery.

So from the request: you're not doing anything wrong and those generated hooks look good

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by yassinm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants