@codaline-io/create-apollo-error
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @codaline-io/create-apollo-error

Weekly Downloads

53

Version

0.1.5

License

MIT

Unpacked Size

8.25 kB

Total Files

12

Last publish

Collaborators

  • killercodemonkey
  • marcuskirsch