Skip to content

URQL - interface resolvers in graphcache #1624

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

You must be logged in to vote

I think you'd be best off checking whether cache.resolve({ __typename: 'Dog', id }, 'id') || cache.resolve({ __typename: 'cat', id }, 'id') returns a field and use that. The cache is the thirth parameter of your function there.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@01jonathanf
Comment options

@JoviDeCroock
Comment options

Answer selected by 01jonathanf
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