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 specific case for requesting `__typename` on interface entity type
In certain cases, when resolving a `__typename` on an interface entity (due
to it actual being requested in the operation), that fetch group could
previously be trimmed / treated as useless. At a glance, it appears to be a
redundant step, i.e.:
```
{ ... on Product { __typename id }} => { ... on Product { __typename} }
```
It's actually necessary to preserve this in the case that we're coming from an
interface object to an (entity) interface so that we can resolve the concrete
`__typename` correctly.
Ref: #2743 (this fixes one of the queries from the issue but not both)
…#2778)
In certain cases, the query planner was preserving some fetches which were "useless"
that would rewrite `__typename` from its already-resolved concrete type back to its
interface type. This could result in (at least) requested fields being "filtered" from the
final result due to the interface's `__typename` in the data where the concrete type's
`__typename` was expected.
Specifically, the solution was compute the path between newly created groups and
their parents when we know that it's trivial (`[]`). Further along in the planning
process, this allows to actually remove the known-useless group.
Fixes#2743 (pt 2)
Co-authored-by: Sylvain Lebresne <[email protected]>
Issue Description
I'm experiencing a very strange behaviour using the @interfaceObject directive
Considering 3 services
Service 1:
Service 2:
Service 3:
depending on the query, it may failed, suceed or be inconsistant
=> ok
=> error "Cannot return null for non-nullable array element of type Product at index 0"
=> inconsistant result, missing reviews field
I have linked a github repo to reproduce this issue. I'm pretty sure the implementation is correct according the documentation
Link to Reproduction
https://github.com/maxrad82/apollo-federation-bug-interface
Reproduction Steps
Prerequisite:
clone the repository and run make run to start the subgraphs and the supergraph
go to http://localhost:4007
run the followng queries:
=> ok
=> fails
=> reviews is not return
The text was updated successfully, but these errors were encountered: