https://github.com/codaline-io/create-apollo-error
smart helper to create errors for apollo server >=v4
https://github.com/codaline-io/create-apollo-error
Last synced: over 1 year ago
JSON representation
smart helper to create errors for apollo server >=v4
- Host: GitHub
- URL: https://github.com/codaline-io/create-apollo-error
- Owner: codaline-io
- License: mit
- Created: 2022-11-14T07:09:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T10:00:08.000Z (over 2 years ago)
- Last Synced: 2025-02-25T20:47:08.568Z (over 1 year ago)
- Language: TypeScript
- Size: 417 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# create-apollo-error
smart helper to create errors for apollo server >=v4
## Usage
```TS
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