0.0.85 • Published 3 years ago

@grund/errors-gql v0.0.85

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@grund/errors-gql

This package exposes helper functions from two categories;

  • parsing - which is performed by the client
  • formatting - which is performed by the graphql server.

Parsing

The parsing is performed on the client side. It takes in a GraphQLFormattedError and throw a CustomError. You can read more about the GraphQL spec here: https://spec.graphql.org/June2018

Formatting

The formatting is performed on the server side. It takes in a GraphQLError that is provided by the graphql server and transformes it into a GraphQLFormattedError. However, this specific formatted error contains such information that the parsing function can transform it into a CustomError.