Skip to content

Latest commit

 

History

History
37 lines (34 loc) · 727 Bytes

README.md

File metadata and controls

37 lines (34 loc) · 727 Bytes

Usage

import { getApolloBugsnagPlugin } from 'apollo-server-plugin-bugsnag';

...
const server = new ApolloServer({
  ...,
  plugins: [
    getApolloBugsnagPlugin(
      // error callback
      (event, requestContext) => {
        // my context has a `state` object that I can use to enchance
        // notify calls
        return {
          user: requestContext.state.user,
        };
      }
    )
  ],
});

Install

# via npm
npm install apollo-server-plugin-bugsnag
# or via yarn
yarn add apollo-server-plugin-bugsnag

If using bugsnag 6.x

# via npm
npm install [email protected]
# or via yarn
yarn add [email protected]