This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree 1 file changed +8
-3
lines changed 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -357,11 +357,15 @@ function graphqlHTTP(options: Options): Middleware {
357
357
// Note: Information about the error itself will still be contained in
358
358
// the resulting JSON payload.
359
359
// https://graphql.github.io/graphql-spec/#sec-Data
360
- if ( response . statusCode === 200 && result && ! result . data ) {
360
+ if (
361
+ response . statusCode === 200 &&
362
+ result != null &&
363
+ result . data == null
364
+ ) {
361
365
response . statusCode = 500 ;
362
366
}
363
367
// Format any encountered errors.
364
- if ( result && result . errors ) {
368
+ if ( result ? .errors ) {
365
369
( result : any ) . errors = result . errors . map ( formatErrorFn ) ;
366
370
}
367
371
@@ -443,7 +447,8 @@ export type GraphQLParams = {|
443
447
module . exports . getGraphQLParams = getGraphQLParams ;
444
448
async function getGraphQLParams ( request : $Request ) : Promise < GraphQLParams > {
445
449
const bodyData = await parseBody ( request ) ;
446
- const urlData = ( request . url && url . parse ( request . url , true ) . query ) || { } ;
450
+ const urlData =
451
+ ( request . url != null && url . parse ( request . url , true ) . query ) || { } ;
447
452
448
453
return parseGraphQLParams ( urlData , bodyData ) ;
449
454
}
You can’t perform that action at this time.
0 commit comments