graphql-hive / graphql-hive/envelop

sentry plugin does not report ScalarType errors for resolved values

Open
#1,808 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
827
Forks
132
PR merge metrics
No merged PRs in 30d

Description

## Breakdown

These errors thrown within graphql scalar types `serialize` function are unreported but should IMHO as this indicates something wrong within the GraphQL resolvers.

![image](https://github.com/n1ru4l/envelop/assets/14338007/1143ec99-f45c-46a3-99f6-2826018cc579)

However, it is currently hard to catch these due to how we detect "unexpected" errors.
Any `GraphQLError` that has an `originalError` property that is not a `GraphQLError` is considered an unexpected error.
Any `GraphQLError` that has an `originalError` property which is a `GraphQLError` is considered an expected error.

This feels a bit inconsistent with how errors are asserted in other places. E.g. a resolver field non-`null` check will raise an `Error` instead of a `GraphQLError`.
image

## Possible solutions for the problem

1. Talk with graphql-js maintainers and convince them to throw `Error` instead of `GraphQLError` within the scalar functions.
2. Add a way of wrapping/manipulating the schema for adding additional information to the error objects

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.