-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of __typename
affects presence of fragment spread data on interfaces
#2587
Comments
could you show the request and response coming in and out of the subgraph? |
Happy to. I've tried doing the experimental logger thing, but that didn't work for me. May have to wire shark it. |
So I edited this issue, after taking the time to actually isolate it, rather than deriving from production code. This reproduces the issue: https://github.com/carldunham/apollo-router-2587 |
OK, so I was able to get the logging to work. Router is definitely asking for (and getting) the right data from the subgraph, but seems to be dropping it for its response. https://github.com/carldunham/apollo-router-2587/blob/main/log.json |
Any updates here? |
Marking as high priority as it is a correctness issue. |
Let's look at the reproduction provided above and see if this still exists or if it's been resolved with some of our query planner updates in recent versions @carldunham: if you already know that it's resolved or not resolved, please let us know! 😄 |
__typename
affects presence of fragment spread data on interfaces
Here's a couple of fresh screenshots, using router 1.28.1: The bug is still present, I'm going to look into it! I'd also like to spend a minute to show gratitude for such a well written issue, the STRs, and even the repository. Super appreciated! I'm going to write a failing test and check what happens For info here's the subgraph request being made, and the subgraph response received: # request
query dog__animal__0{
dog {
id
name
}
} {
"data":{
"dog":{
"id":"4321",
"name":"Spot"
}
}
} |
Fix #2587 Operations would over rely on the presence of __typename to resolve selection sets on interface implementers. This changeset checks for the parent type in an InlineFragment, so we don't drop relevant selection set when applicable.
Fix #2587 Operations would over rely on the presence of __typename to resolve selection sets on interface implementers. This changeset checks for the parent type in an InlineFragment, so we don't drop relevant selection set when applicable.
Describe the bug
We are seeing a difference in behavior between Apollo Gateway and Router that looks like a bug in Router.
Not sure what the spec really should be, but we have these in the wild.
Given schema:
Issuing the query
Gives the result
Uncomment
__typename
(or use Gateway as the server), and you getAlso, changing the query to not nest will work:
To Reproduce
Implement the above schema in a Router service and run the given query(ies).
Expected behavior
We expect that the results from Router would be the same as from Gateway.
Output
See above.
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: