Skip to content

Instantly share code, notes, and snippets.

@efueyo
Created April 24, 2021 01:38
Show Gist options
  • Save efueyo/d9096950c0bcff8670aa0f4b87cf152b to your computer and use it in GitHub Desktop.
Save efueyo/d9096950c0bcff8670aa0f4b87cf152b to your computer and use it in GitHub Desktop.
Apollo-Sentry-Server
import { ApolloServer } from "apollo-server-micro"
import { createContext } from "./context"
import SentryPlugin from "./sentry-plugin"
const apolloServer = new ApolloServer({
// ... your ApolloServer options
// Create context function
context: ({ req, connection }) => createContext({ req, connection }),
// Add our sentry plugin
plugins: [SentryPlugin],
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment