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', () => {
2190
2190
expect ( seenExecuteArgs ) . to . not . equal ( null ) ;
2191
2191
} ) ;
2192
2192
2193
- it . only ( 'catches errors thrown from custom execute function' , async ( ) => {
2193
+ it ( 'catches errors thrown from custom execute function' , async ( ) => {
2194
2194
const app = server ( ) ;
2195
2195
2196
2196
app . get (
Original file line number Diff line number Diff line change @@ -2,31 +2,31 @@ import type { IncomingMessage, ServerResponse } from 'http';
2
2
3
3
import type {
4
4
DocumentNode ,
5
- ValidationRule ,
6
5
ExecutionArgs ,
7
6
ExecutionResult ,
8
7
FormattedExecutionResult ,
9
- GraphQLSchema ,
10
8
GraphQLFieldResolver ,
11
- GraphQLTypeResolver ,
12
9
GraphQLFormattedError ,
10
+ GraphQLSchema ,
11
+ GraphQLTypeResolver ,
12
+ ValidationRule ,
13
13
} from 'graphql' ;
14
- import accepts from 'accepts' ;
15
- import httpError from 'http-errors' ;
16
14
import {
17
- Source ,
15
+ execute ,
16
+ getOperationAST ,
18
17
GraphQLError ,
19
18
parse ,
19
+ Source ,
20
+ specifiedRules ,
20
21
validate ,
21
- execute ,
22
22
validateSchema ,
23
- getOperationAST ,
24
- specifiedRules ,
25
23
} from 'graphql' ;
24
+ import accepts from 'accepts' ;
25
+ import httpError from 'http-errors' ;
26
26
27
- import type { GraphiQLOptions , GraphiQLData } from './renderGraphiQL' ;
28
- import { parseBody } from './parseBody' ;
27
+ import type { GraphiQLData , GraphiQLOptions } from './renderGraphiQL' ;
29
28
import { renderGraphiQL } from './renderGraphiQL' ;
29
+ import { parseBody } from './parseBody' ;
30
30
31
31
// `url` is always defined for IncomingMessage coming from http.Server
32
32
type Request = IncomingMessage & { url : string } ;
@@ -194,7 +194,15 @@ export function graphqlHTTP(options: Options): Middleware {
194
194
let showGraphiQL = false ;
195
195
let graphiqlOptions : GraphiQLOptions | undefined ;
196
196
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
+ ) ;
198
206
let pretty = false ;
199
207
let result : ExecutionResult ;
200
208
You can’t perform that action at this time.
0 commit comments