Skip to content

Commit 540a262

Browse files
committed
If we crafted a GraphQL Error in our Resolver code, don't mess with it,
return it untouched.
1 parent 25614ea commit 540a262

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

subscriptions.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func (s *Schema) subscribe(ctx context.Context, queryString string, operationNam
4040

4141
op, err := getOperation(doc, operationName)
4242
if err != nil {
43+
if gqlError, ok := err.(*qerrors.QueryError); ok {
44+
return sendAndReturnClosed(&Response{Errors: []*qerrors.QueryError{gqlError}})
45+
}
4346
return sendAndReturnClosed(&Response{Errors: []*qerrors.QueryError{qerrors.Errorf("%s", err)}})
4447
}
4548

0 commit comments

Comments
 (0)