Skip to content

Urql generation #5683

Answered by dotansimha
arcanis asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @arcanis ! I can recommend you to use typed-document-node (see https://the-guild.dev/blog/typed-document-node). It supported natively by urql and you should get a better type-safety and clean bundle. Also, result.data will be the same one from Urql, because we don't need a wrapper. I think Urql consider data to be nullable because it follows the signature of graphql - where it can return errors: [ ... ], data: null in some cases.

Regarding __typename - By default, the typescript-operations adds __typename to each level, it should be there.
We currently don't have a built-in solution for adding new fields, but you can use custom documents loader (https://graphql-code-generator.com/docs/…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arcanis
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