Skip to content

Type error on custom key #3651

Answered by kitten
lsarni asked this question in Q&A
Discussion options

You must be logged in to vote

No, without typegen there's no way of knowing what the scalar value of the field may be. Hence, it's typed more generically, and if you know the type you should cast it to indicate that it's safe.

In general, these are the kind of cases where typegen is really useful: https://www.npmjs.com/package/@graphql-codegen/typescript-urql-graphcache
However, we haven't replaced the GraphQL Codegen plugin with our own implementation, e.g. in gql.tada yet.

Replies: 1 comment

Comment options

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