Skip to content

How to force urql to give __typename always, even on cache hit return? #1241

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

You must be logged in to vote

It's normal that urql doesn't add __typename automatically to the root type of the document. In general you shouldn't rely on this and instead should assume that it merely may be there unless you explicitly ask for it.

That being said Graphcache and the document transform in @urql/core in general adds the __typename field to any selection set except for the root selection set on your root types.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@RIP21
Comment options

Answer selected by RIP21
Comment options

You must be logged in to vote
5 replies
@kitten
Comment options

@wereHamster
Comment options

@kitten
Comment options

@dylan-chong
Comment options

@kitten
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants