Skip to content
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

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

Closed
elhorowitz opened this issue Sep 1, 2017 · 2 comments

Comments

@elhorowitz
Copy link

This issue is related to #156

Intended outcome:
Mutations should not return rejected promises if the server response includes an empty errors array.

While this behavior is technically spec compliant:

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.

Some servers (like graphql-java) do not follow the specs explicitly: graphql-java/graphql-java#473

Actual outcome:
Successful mutation responses using the graphql_java server provide the following on success:

{
  data: { Response },
  errors: [],
  extensions: []
}

The apollo-client mutation code (specifically this line) rejects the query if response.errors exists, so it is therefore rejecting successful requests.

#173 updated apollo client's query code to be less rigid, a similar fix is needed for mutations.

Version

@stale
Copy link

stale bot commented Sep 22, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client!

@stale
Copy link

stale bot commented Oct 6, 2017

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client!

@stale stale bot closed this as completed Oct 6, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant