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

fix: extensions argument ignored by ForbiddenError and AuthorizationError #5309

Conversation

bristoljon
Copy link
Contributor

As raised here, currently only UserInputError supports passing arbitrary data in the extensions argument but the docs imply all ApolloError's support this.

This MR allows passing the extra extensions argument to the underlying constructor.

I did also attempt to apply this to all the Error classes (except persisted ones) but ran into some typescript errors caused by invalid sendErrorResponse calls in apollo-server-core/src/requestPipeline.ts so I just applied the changes to ForbiddenError and AuthorizationError.

Perhaps this inconsistency means the docs should also be updated to clarify which error constructors support extensions too but thought I'd get the ball rolling with this fix MR

@apollo-cla
Copy link

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

@glasser
Copy link
Member

glasser commented Jun 15, 2021

Thanks!

@glasser glasser merged commit 429c504 into apollographql:release-3.0 Jun 15, 2021
glasser added a commit that referenced this pull request Jun 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 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.

None yet

3 participants