-
Notifications
You must be signed in to change notification settings - Fork 253
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
Feature request: Apollo server plugin #1703
Comments
Hi @villesau, Thanks for the suggestion. We are already looking into ways to better support Apollo Server/GraphQL errors so this is definitely on our radar. We don't have any timeframes at this stage or exactly what it would look like but we will let you know of updates here. |
Nice, thanks for the info! I've tried this:
But it does not work and needs improvement to capture stacktraces and error details. Apollo throws GraphQLError which holds the stacktrace differently. Here are further details of error handling: https://www.apollographql.com/docs/apollo-server/data/errors/ |
@johnkiely1 something like this could be a good starting point: const bugsnagPlugin = (): ApolloServerPlugin => ({
requestDidStart: async () => ({
async didEncounterErrors(requestContext) {
requestContext.errors.forEach(error => {
Bugsnag.notify(error, event => {
event.addMetadata('GraphQLMetadata', {
path: error.path
});
});
});
}
})
}); See this for the reference: https://www.apollographql.com/docs/apollo-server/integrations/plugins-event-reference/#didencountererrors There's likely plenty of good heuristics that could be added as a metadata. |
@johnkiely1 any news on this? Apollo is more popular than many of the other plugins provided so far. |
This is how we currently forward apollo errors to bugsnag:
|
Hi @villesau, unfortunately we don't have any updates at this time. This work is still on our backlog but we have not yet been able to get to it. We will update here as soon as we have any information to share. |
Description
Apollo server is a popular framework and has a special way of handling errors. Would make sense if Bugsnag would have 1st party package handling Apollo server errors.
Describe the solution you'd like
Either a plugin, or a function passed to apollos
formatError
hook.The text was updated successfully, but these errors were encountered: