Open abc-moviestarplanet opened 1 year ago
Thanks for reporting!
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
Here is a repository with steps to reproduce: https://github.com/abc-moviestarplanet/GatewayResolverIssue/tree/main
@marco-ippolito could you take a look?
probably related to https://github.com/mercurius-js/mercurius-gateway/issues/22
Hi, have you find why it doesn't work ? i think my issue is the same 😭 https://github.com/mercurius-js/mercurius-gateway/issues/114 It's blocker for me....
Given the following 2 graphql subgraphs:
Subgraph 1:
Subgraph 2:
Subgraph 2 has a resolver for
friends
which always returns some data.If I run the following query against the Gateway:
The response is:
And the friends resolver never triggers.
I can get the data for friends correctly if I manually query subgraph 2 directly like this:
So from what I can understand, the Gateway is not requesting the "friends" data from Subgraph 2.
Now if in Subgraph 2 I rename the type
PageOfUser
toPageOfFriends
(a name that is different from that defined in Subgraph 1) then it works fine through the Gateway.According to this https://www.apollographql.com/docs/federation/v1/value-types/, it is fine for the subgraphs to define the same types multiple times, as long as they are exactly identical.
Is this a bug or a misuse of federation?
Sample to reproduce:
https://github.com/abc-moviestarplanet/GatewayResolverIssue/tree/main