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
To my understanding, every time (in this situation where there are two subgraphs) when a gateway asks for User.profile it has to be resolved by subgraph A.
When I query:
query {
user { # resolved by Bprofile { # resolved by Abio # resolved by A
}
}
}
This one is easy, so let’s complicate it a bit by adding an entity on top of it all and @provides directive.
And at this point I have two questions.
Should @override on User.profile be ignored if provided fields (see @provides) can resolve the { user { profile { bio } } } part of the query?
query {
dashboard { # Buser { # Bprofile { # B, but should it be B?bio # B
}
}
}
}
In my opinion, if we allow to bypass @override when a query path matches @provides(fields:) then we should be very specific about it and describe this behavior well in the spec.
The next question, but more obvious is what should happen when a user requests Profile.id as well, or Profile.name, so instead of profile { bio } there’s profile { bio id name }.
I checked how gateways are handling it (for the audit I did) and all of them are not following any rules consistently.
The text was updated successfully, but these errors were encountered:
every time an overridden field is to be resolved, use the overriding subgraph instead
or
treat overridden field as @external, but if it is to be resolved directly (not through a query path with @provides), used the overriding subgraph instead
Because if we treat it only as @external, then the definition from Apollo Federation docs that I mentioned in the issue:
@override indicates that an object field is now resolved by this subgraph instead of another subgraph where it’s also defined.
is no longer true when there are more subgraphs defining that field.
Since we have
@override
in the spec I wanted us to define its behavior a bit.In Apollo Federation, the definition of the is:
Here’s a simple example, but I will dive deeper soon :)
To my understanding, every time (in this situation where there are two subgraphs) when a gateway asks for
User.profile
it has to be resolved by subgraphA
.When I query:
This one is easy, so let’s complicate it a bit by adding an entity on top of it all and
@provides
directive.And at this point I have two questions.
Should
@override
onUser.profile
be ignored if provided fields (see@provides
) can resolve the{ user { profile { bio } } }
part of the query?In my opinion, if we allow to bypass
@override
when a query path matches@provides(fields:)
then we should be very specific about it and describe this behavior well in the spec.The next question, but more obvious is what should happen when a user requests
Profile.id
as well, orProfile.name
, so instead ofprofile { bio }
there’sprofile { bio id name }
.I checked how gateways are handling it (for the audit I did) and all of them are not following any rules consistently.
The text was updated successfully, but these errors were encountered: