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

Return correct HTTP code if context creation fails #2093

Closed
wants to merge 2 commits into from

Conversation

MrLoh
Copy link

@MrLoh MrLoh commented Dec 13, 2018

Here's a proposal to fix #1709 in cases, where apollo already returns a 400 response, to handle the default AuthenticationError and ForbiddenError with fitting HTTP status codes. It doesn't make sense, that these errors set a status code, when thrown from a resolver, since partial data might still be returned in that case, but when the context creation fails, Apollo might as well return a more meaningful status code.

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

@apollo-cla
Copy link

@MrLoh: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@anilexpedia
Copy link

Any idea when this will be merged? I think this is useful functionality to expose through graphql.

@pragone
Copy link

pragone commented Feb 4, 2019

Hey... This PR seems to have gone a bit stale, so I've resubmitted as #2269

@MrLoh MrLoh closed this Feb 4, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 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

Successfully merging this pull request may close these issues.

throwing AuthenticationError should set the response status to 401 Unauthorized
4 participants