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
Fix potential bug when an @interfaceObject has a @requires (#2524)
When an `@interfaceObject` type has a field with a `@requires` and the
query requests that field only for some specific implementations of the
corresponding interface, then the generated query plan was sometimes
invalid and could result in an invalid query to a subgraph (against a
subgraph that rely on `@apollo/subgraph`, this lead the subgraph to
produce an error message looking like `"The _entities resolver tried to
load an entity for type X, but no object or interface type of that name
was found in the schema"`).
The underlying reason is that the plan was mistakenly requesting the
required fields for any object of the interface (corresponding to the
`@interfaceObject` in question), instead of only requesting them only
for only the implementation types it needed to. Not only is that
inefficient in principle, but this lead to invalid fetches because the
"rewrite" logic used to fixup the `__typename` for `@interfaceObject`
under the hood was only rewriting the types of the implementation types
in question (only expecting those to need rewrite, which technically was
correct) but was mistakenly getting values for other implementation
types.
0 commit comments