Skip to content

Using cache.invalidate TS is complaining about SystemFields.id?: string | number #1462

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

You must be logged in to vote

It's because the type is extremely generic with every possible GraphQL scalar value (or sometimes even objects, depending on the method call), so you'll need to cast id, e.g. id as string. That's until we add type generation for Graphcache.

Also on a side note, you likely don't want to use info.variables and only use it if there's no alternative. Instead it looks like args.id or sth may be available for playerDelete depending on your schema.

Replies: 1 comment

Comment options

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