question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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);

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
helfercommented, May 3, 2016

@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.

1reaction
WilliamHolmescommented, May 3, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Some GraphQL servers return an empty error array ... - GitHub
While this behavior is technically spec compliant: The errors entry in the response is a non‐empty list of errors, where each error is...
Read more >
Error handling - Apollo GraphQL Docs
This occurs when a request containing multiple named operations doesn't specify which operation to run (i.e., operationName ), or if the named operation...
Read more >
GraphQL for mergeRequests returns empty array - GitLab.org
Query mergeRequests(first: "1") via GraphQL returns empty array, even though there are merge requests. Steps to reproduce. Use GraphiQL and run ...
Read more >
GraphQL specification
Given a query, tools can ensure that the query is both syntactically correct and valid within the GraphQL type system before execution, i.e....
Read more >
GraphQL: Non-nullable array/list - Stack Overflow
If you need to verify whether an array is empty, you have to do so within your resolver logic. If you want GraphQL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found