-
Notifications
You must be signed in to change notification settings - Fork 134
Closed
Milestone
Description
Is your feature request related to a problem? Please describe.
Right now we use EnvelopError which extends GraphQLError for identifying whether an error should be masked or not.
We choose to use a custom EnvelopError because the GraphQLError constructor API was cumbersome. We changed this within graphql/graphql-js#3454
Instead of
throw new GraphQLError("Oops.", undefined, undefined, undefined, undefined, { code: "SERVER_GOES_BRRT" })We can now instantiate a GraphQLError with extensions via the new object constructor overload:
throw new GraphQLError("Oops.", {
extensions: { code: "SERVER_GOES_BRRT" },
})Describe the solution you'd like
Replace EnvelopError with GraphQLError. This might be a breaking change though we could potentially work around it by just alias exporting GraphQLError as EnvelopError 🤔 .
import { GraphQLError } from "graphql";
export const EnvelopError = GraphQLErrorHowever, since the constructor changes that would still be a breaking change.
Metadata
Metadata
Assignees
Labels
No labels