Open vigie opened 3 years ago
Thanks @vigie - any chance you could put together a small runnable reproduction that demonstrates this?
We haven't heard back about a reproduction, so I'll close this for now (happy to re-open if anyone can provide a small runnable repro). Thanks!
Sorry for the delay, I was on parental leave.
Here is a simple repo https://github.com/vigie/react-apollo-error-template
Let me know if you need more context. From the commit message of the above fork:
In Apollo dev tools, notice that the result of executing the following query includes people id, even though it was not asked for
query AllPeople { people @client { name } }
However, put a breakpoint on line 19 of App.js and notice that the apollo client itself is correctly filtering out data not requested before returning it to the caller.
Apollo dev tools should do the same in its GraphiQL tab.
Here is a screenshot of the problem as I see it, using the above repo:
@hwillson can this be reopened for investigation now?
Compare the above with the correct behavior of Apollo Client as inspected by Chrome debugger:
Now that I've added the required info, can this at least be re-opened for tracking purposes @hwillson ?
@vigie sorry about that, re-opening. Thanks for the repro!
I'd like to have a go at fixing this, @hwillson if you have any suspicions about the cause please let me know, thanks
Hi @vigie ! From my local testing, it's looking like this issue has been resolved with the Apollo Studio integration introduced in DevTools 4.0.0. Are you still experiencing the issue? If not, I'll be happy to close this within a few days.
All the best, Emmanuel :-)
Now matches the data result in the Chrome Debugger
Hi @MrDoomBringer
If you uncheck the "load from cache" option, you'll find that the issue still exists. Thanks for investigating.
Intended outcome: Execute a
@client
query against local resolvers from GraphiQL and see in the result only the fields asked for in the query.Actual outcome: The entire object as returned by the local resolver is displayed
How to reproduce the issue:
Create a local resolver to implement
Execute query in GraphiQL
You will see both
a
andb
fields returned in the result pane, instead of justa
.Note that the Apollo client itself does not suffer from this problem - that is, in code the result emitted by the observable will be correctly filtered based on the selection set.
This issue makes giving demos/trainings to show the flexible nature of GQL particularly frustrating.
Desktop (please complete the following information):