graphql-middleware-rollbar
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

GraphQL Middleware for Rollbar

Drop in middleware for GraphQL-Yoga that catches and publishes non-schema-related (i.e., resolver-level) errors to your Rollbar service.

If you haven't yet created a Rollbar account for your project(s), you will need to sign up.

npm install graphql-middleware-rollbar

Then, include the following when instantiating your graphql-yoga server like:

import { rollbar } from 'graphql-middleware-rollbar'
 
const rollbarMiddleware = rollbar({
    rollbarAccessToken: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' // REPLACE WITH YOUR ROLLBAR API KEY
    })
...
 
const server = new GraphQLServer({
    ...
    middlewares[rollbarMiddleware],
    ...
})
 
server.start(() => console.log('All my resolver-level errors are being reported to Rollbar!'))

Readme

Keywords

none

Package Sidebar

Install

npm i graphql-middleware-rollbar

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

11.6 kB

Total Files

9

Last publish

Collaborators

  • medelman17