graphql/envelop/plugins/use-error-handler #1751
Replies: 3 comments 4 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
The export declare function isGraphQLError(error: unknown): error is Error & {
originalError?: Error;
}; So if you would want to create another error check to see if it has extensions errors, this would cause the typing to fail because function isGraphQLErrorExtensions(error: unknown): error is GraphQLError & {
extensions: NonNullable<GraphQLError['extensions']>;
} {
return (
isGraphQLError(error) &&
error.extensions !== null &&
error.extensions !== undefined &&
typeof error?.extensions === 'object'
);
} |
Beta Was this translation helpful? Give feedback.
-
This really needs a lot more details. The type for errors: {
errors: readonly Error[] | readonly SerializableGraphQLErrorLike[];
context: Readonly<DefaultContext>;
phase: "parse" | "validate" | "context" | "execution";
}
|
Beta Was this translation helpful? Give feedback.
-
graphql/envelop/plugins/use-error-handler
GraphQL Envelop Documentation
https://the-guild.dev/graphql/envelop/plugins/use-error-handler
Beta Was this translation helpful? Give feedback.
All reactions