apollo-client: Some GraphQL servers return an empty error array, even though it's not spec compliant

Our GraphQL schema QueryRoot contains a type Viewer which we use to query most of the data. Apollo doesn’t seem to like this causing the error Can't find field viewer on object [object Object] I have validated (and verified the response) with this simple query using GraphiQL Query { viewer { me { displayName } } } Response { "data": { "viewer": { "me": { "displayName": "William Holmes" } } }, "errors": [] }

REF: apollostack/apollo-client/src/networkInterface.ts#L91

I’m using React Integration with mapQueriesToProps and connect

export default connect({ mapQueriesToProps })(MyComponent);

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 4
  • Comments: 23 (14 by maintainers)

Commits related to this issue

Most upvoted comments

@WilliamHolmes I think you should file an issue on graphql-java. The GraphQL spec says:

The errors entry in the response is a non‐empty list of errors, where each error is a map.

If no errors were encountered during the requested operation, the errors entry should not be present in the result.

I’ll take a look soon, thanks for reporting!