You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FilterToSchema leaves behind an empty selection set which fails validation on a remote graphql server:
queryCustomerQuery {
customer {
nameaddress
}
}
Actual outcome:
FilterToSchema should remove fields with empty selection sets:
queryCustomerQuery {
customer {
name
}
}
How to reproduce the issue:
I'm preparing a PR based on this branch which includes unit tests that reproduce the error and some code changes to resolve it.
The text was updated successfully, but these errors were encountered:
As an addendum to this, I'm sure there are other scenarios that I haven't accounted for (empty selection sets on inline fragments?), and I can see the code for this getting more complex over time. A friend of mine (@brysgo) tackled this problem by leveraging GraphQL's built in validation. It might be prudent to take a look at his approach (graphql-mask)
adamkl
added a commit
to adamkl/graphql-tools
that referenced
this issue
Jun 1, 2018
Intended outcome:
Given target schema:
And query:
FilterToSchema leaves behind an empty selection set which fails validation on a remote graphql server:
Actual outcome:
FilterToSchema should remove fields with empty selection sets:
How to reproduce the issue:
I'm preparing a PR based on this branch which includes unit tests that reproduce the error and some code changes to resolve it.
The text was updated successfully, but these errors were encountered: