The Guild LogoThe Guild Monogram

Search docs

Search icon

Products by The Guild

Products

Hive logoHive blurred logo

Hive

Schema Registry for your GraphQL Workflows

Envelop Logo

Envelop

Get Started

Plugin Hub > useErrorHandler

yarn add @envelop/core

useErrorHandler#

This plugin triggers a custom function when execution encounters an error.

import { envelop, useErrorHandler } from '@envelop/core'; import { buildSchema } from 'graphql'; const getEnveloped = envelop({ plugins: [ useErrorHandler((errors, args) => { // This callback is called once, containing all GraphQLError emitted during execution phase }), // ... other plugins ... ], });

Plugin Details