@codaline-io/create-apollo-error
v0.1.5
Published
Just a small helper method to easier error creation with apollo graphql server >= 4
Downloads
650
Readme
create-apollo-error
smart helper to create errors for apollo server >=v4
Usage
import { createApolloError } from '@codaline-io/create-apollo-error'
throw createApolloError(message, optionalErrorCode, optionalErrorType, optionalGraphQLErrorOptions)
- optionalErrorCode?: string | null -> graphqlError.extensions.code
- optionalErrorType?: string | null -> graphqlError.extensions.type
- optionalGraphQLErrorOptions?: GraphQLErrorOptions, e.g. setting original error and so on