-
Notifications
You must be signed in to change notification settings - Fork 166
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
When executing a @client query, result is not filtered to the selection set #477
Comments
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! |
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.
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:
|
Here is a screenshot of the problem as I see it, using the above repo: @hwillson can this be reopened for investigation now? |
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 ! All the best, |
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):
The text was updated successfully, but these errors were encountered: