You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please add a throw or a warning when "possibleTypes" are not configured and data requiring them is queried. Currently apollo-client returns empty object which obviously wreaks havoc at runtime.
Resolving this issue should make this common misconfiguration issue easier to identify and resolve: #6632
The text was updated successfully, but these errors were encountered:
Unfortunately, I think I spoke too soon, since any fragment's type condition could match a given __typename exactly, without any help from possibleTypes.
This is a problem for identifying (and warning about) fragments that will never match, since the client doesn't know which types are abstract (and thus require an entry in possibleTypes) and which types might be concrete (and thus could match exactly). Communicating this information to the client/cache would most likely involve adding information to possibleTypes anyway, so the warnings wouldn't become useful until you'd already done that work.
I'm open to other ideas about how and when to warn about unmatchable fragments, but I don't think my first idea will work.
I just lost a few hours for the second time until I realized possibleTypes declaration was missing. The first time was a few months ago, an ancient past for my brain...
Users are sending valid queries, and InMemoryCache cannot properly operate without possibleTypes set (hiding server-returned content is a huge bug). Hence it should be made a required config to highlight to users its importance.
Please add a throw or a warning when "possibleTypes" are not configured and data requiring them is queried. Currently apollo-client returns empty object which obviously wreaks havoc at runtime.
Resolving this issue should make this common misconfiguration issue easier to identify and resolve: #6632
The text was updated successfully, but these errors were encountered: