@@ -20,6 +20,8 @@ class AbsoluteGraphQLError implements GraphQLError {
2020 private final List <SourceLocation > locations ;
2121 private final List <Object > absolutePath ;
2222 private final GraphQLError relativeError ;
23+ private final String message ;
24+ private final ErrorType errorType ;
2325
2426 AbsoluteGraphQLError (ExecutionStrategyParameters executionStrategyParameters , GraphQLError relativeError ) {
2527 requireNonNull (executionStrategyParameters );
@@ -35,7 +37,7 @@ class AbsoluteGraphQLError implements GraphQLError {
3537
3638 Optional <SourceLocation > baseLocation ;
3739 if (!executionStrategyParameters .field ().isEmpty ()) {
38- baseLocation = Optional .of (executionStrategyParameters .field ().get (0 ).getSourceLocation ());
40+ baseLocation = Optional .ofNullable (executionStrategyParameters .field ().get (0 ).getSourceLocation ());
3941 } else {
4042 baseLocation = Optional .empty ();
4143 }
@@ -49,11 +51,13 @@ class AbsoluteGraphQLError implements GraphQLError {
4951 .orElse (null ))
5052 .collect (Collectors .toList ()))
5153 .orElse (null );
54+ this .message = relativeError .getMessage ();
55+ this .errorType = relativeError .getErrorType ();
5256 }
5357
5458 @ Override
5559 public String getMessage () {
56- return relativeError . getMessage () ;
60+ return message ;
5761 }
5862
5963 @ Override
@@ -63,7 +67,7 @@ public List<SourceLocation> getLocations() {
6367
6468 @ Override
6569 public ErrorType getErrorType () {
66- return relativeError . getErrorType () ;
70+ return errorType ;
6771 }
6872
6973 @ Override
0 commit comments