apollographql / apollographql/apollo-client-devtools

When executing a @client query, result is not filtered to the selection set

Open
#477 10 comments 0 reactions 0 assignees View on GitHub
:rose: has-reproduction
Dominant language
TypeScript
Stars
1.5k
Forks
172
Avg merge
10m
Merged PRs (30d)
8

Description

**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

```
type Query {
foo: Bar
}

type Bar {
a: int
b: int
}
```

Execute query in GraphiQL

```
query {
foo {
a
}
}
```

You will see both `a` and `b` fields returned in the result pane, instead of just `a`.

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):**
- OS: Mac BIg Sur
- Browser Chrome
- Chrome version: 89.0.4389.90
- Extension version: 3.0.2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.