Skip to content

Is the disclaimer for the maskFragments method misleading? #338

Closed Answered by kitten
pmooney-socraticworks asked this question in Q&A
Discussion options

You must be logged in to vote

This is an "Apollo-ism", but when we say:

You shouldn’t have to use it in your regular component code.

We mean that it's unexpected for regular UI code to assemble typed queries with maskFragments.
The update callback in your above example is not UI code and not component code. While Apollo has patterns that embeds these cache updaters in regular UI code, they're strictly speaking not part of any UI-driven components, but instead, cache configuration.

It's also worth noting — and I don't know if Apollo has added more APIs since then — that using the original query to update the cache is not strictly speaking necessary.
In general what I'd expect is:

  • update should use the second argumen…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pmooney-socraticworks
Comment options

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