Skip to content

Get entity with all fields from cache. #1110

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

You must be logged in to vote

Ultimately you will get warnings if you're missing a field in your optimistic result, along the lines of:

(13) Invalid undefined: [...] Your optimistic result may be missing a field!

But you may notice that this will be issued as a warning. That's because you may have forgotten to return an update for a specific field, but that doesn't mean that this field is necessarily changing. So it's actually safe to ignore this warning at times (and all warnings are muted in production)

So in theory, all fields that you're reading in readFragment to "complete" your optimistic result can be left out. Actually we wanted to ignore this warning if the field was explicitly set to undefined, but I belie…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@saivanji
Comment options

@kitten
Comment options

@saivanji
Comment options

Answer selected by saivanji
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