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

Bug in QueryManager.mutate where both Promise.reject and Promise.resolve are called #1249

Closed
yurigenin opened this issue Feb 1, 2017 · 1 comment
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. 🐞 bug

Comments

@yurigenin
Copy link

yurigenin commented Feb 1, 2017

In the QueryManager.mutate method there is this code:

return new Promise((resolve, reject) => {
      this.networkInterface.query(request)
        .then((result) => {
          if (result.errors) {
            reject(new ApolloError({
              graphQLErrors: result.errors,
            }));
          }

        .............
          resolve(this.transformResult(<ApolloQueryResult<T>>result));
        })

If GraphQL server returns the errors property in its payload a reject is called but there is no return statement after that so the code proceeds further down and calls resolve method.

@calebmer calebmer added 🐞 bug 📚 good-first-issue Issues that are suitable for first-time contributors. labels Feb 1, 2017
@calebmer
Copy link
Contributor

calebmer commented Feb 4, 2017

Thanks for the report @yurigenin!

@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
📚 good-first-issue Issues that are suitable for first-time contributors. 🐞 bug
Projects
None yet
Development

No branches or pull requests

2 participants