This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-13
lines changed
Expand file tree Collapse file tree 2 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -2190,7 +2190,7 @@ describe('GraphQL-HTTP tests for connect', () => {
21902190 expect ( seenExecuteArgs ) . to . not . equal ( null ) ;
21912191 } ) ;
21922192
2193- it . only ( 'catches errors thrown from custom execute function' , async ( ) => {
2193+ it ( 'catches errors thrown from custom execute function' , async ( ) => {
21942194 const app = server ( ) ;
21952195
21962196 app . get (
Original file line number Diff line number Diff line change @@ -2,31 +2,31 @@ import type { IncomingMessage, ServerResponse } from 'http';
22
33import type {
44 DocumentNode ,
5- ValidationRule ,
65 ExecutionArgs ,
76 ExecutionResult ,
87 FormattedExecutionResult ,
9- GraphQLSchema ,
108 GraphQLFieldResolver ,
11- GraphQLTypeResolver ,
129 GraphQLFormattedError ,
10+ GraphQLSchema ,
11+ GraphQLTypeResolver ,
12+ ValidationRule ,
1313} from 'graphql' ;
14- import accepts from 'accepts' ;
15- import httpError from 'http-errors' ;
1614import {
17- Source ,
15+ execute ,
16+ getOperationAST ,
1817 GraphQLError ,
1918 parse ,
19+ Source ,
20+ specifiedRules ,
2021 validate ,
21- execute ,
2222 validateSchema ,
23- getOperationAST ,
24- specifiedRules ,
2523} from 'graphql' ;
24+ import accepts from 'accepts' ;
25+ import httpError from 'http-errors' ;
2626
27- import type { GraphiQLOptions , GraphiQLData } from './renderGraphiQL' ;
28- import { parseBody } from './parseBody' ;
27+ import type { GraphiQLData , GraphiQLOptions } from './renderGraphiQL' ;
2928import { renderGraphiQL } from './renderGraphiQL' ;
29+ import { parseBody } from './parseBody' ;
3030
3131// `url` is always defined for IncomingMessage coming from http.Server
3232type Request = IncomingMessage & { url : string } ;
@@ -194,7 +194,15 @@ export function graphqlHTTP(options: Options): Middleware {
194194 let showGraphiQL = false ;
195195 let graphiqlOptions : GraphiQLOptions | undefined ;
196196 let formatErrorFn = ( error : GraphQLError ) : GraphQLFormattedError =>
197- new GraphQLError ( error . message ) ;
197+ new GraphQLError (
198+ error . message ,
199+ error . nodes ,
200+ error . source ,
201+ error . positions ,
202+ error . path ,
203+ error . originalError ,
204+ error . extensions ,
205+ ) ;
198206 let pretty = false ;
199207 let result : ExecutionResult ;
200208
You can’t perform that action at this time.
0 commit comments