For your Backend
Fullstack Frameworks
Next.JS
Self Host
Menu
Apollo Server
Highlight ships @highlight-run/node
with a plugin ApolloServerHighlightPlugin
specifically for the apollo server.
The plugin will trace graphql resolver errors and report them to Highlight.
Usage
The usage of the Apollo plugin requires the Node.js integration to be configured.
Ensure that @highlight-run/node
updated to version 2.2.0 or greater. Then, add ApolloServerHighlightPlugin
to
your ApolloServer
plugins definition.
import { ApolloServer } from '@apollo/server' import { ApolloServerHighlightPlugin } from '@highlight-run/node' // ... const server = new ApolloServer({ typeDefs, resolvers, plugins: [ApolloServerHighlightPlugin({ projectID: 'YOUR_PROJECT_ID' })], })
Usage on Apollo Server v3 (deprecated)
The following example is for the deprecated ApolloServer v3 (importing from apollo-server-express).
import { ApolloServer } from 'apollo-server-express' import { ApolloServerV3HighlightPlugin } from '@highlight-run/node' // ... const server = new ApolloServer({ typeDefs, resolvers, plugins: [ApolloServerV3HighlightPlugin({ projectID: 'YOUR_PROJECT_ID' })], })
Verify
To validate your Highlight backend setup, you can have a graphql resolver throw an error and check that the error is visible on app.highlight.io.