From d24dfb3ae6ca0a274f2c69ac6ccf2ae77ec03773 Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Wed, 27 Oct 2021 18:22:02 +0300 Subject: [PATCH] GraphQLError: revert `originalError` to be nullable Fix #3340 Partial revert of #3333 Were reverted due to conflict with Apollo Server, see https://github.com/apollographql/apollo-server/issues/5843 --- src/error/GraphQLError.d.ts | 2 +- src/error/GraphQLError.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error/GraphQLError.d.ts b/src/error/GraphQLError.d.ts index bb574f9f05..95f39ba483 100644 --- a/src/error/GraphQLError.d.ts +++ b/src/error/GraphQLError.d.ts @@ -76,7 +76,7 @@ export class GraphQLError extends Error { /** * The original error thrown from a field resolver during execution. */ - readonly originalError: Error | undefined; + readonly originalError: Error | undefined | null; /** * Extension fields to add to the formatted error. diff --git a/src/error/GraphQLError.js b/src/error/GraphQLError.js index 7552bb473d..d3068adacb 100644 --- a/src/error/GraphQLError.js +++ b/src/error/GraphQLError.js @@ -56,7 +56,7 @@ export class GraphQLError extends Error { /** * The original error thrown from a field resolver during execution. */ - +originalError: Error | void; + +originalError: Error | void | null; /** * Extension fields to add to the formatted error.