Skip to content

codaline-io/create-apollo-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

smart helper to create errors for apollo server >=v4

Resources

License

Stars

Watchers

Forks

Packages

No packages published