This repository was archived by the owner on Mar 20, 2023. It is now read-only. 
      
File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 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 {
357357 // Note: Information about the error itself will still be contained in 
358358 // the resulting JSON payload. 
359359 // 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+  )  { 
361365 response . statusCode  =  500 ; 
362366 } 
363367 // Format any encountered errors. 
364-  if  ( result   &&   result . errors )  { 
368+  if  ( result ? .errors )  { 
365369 ( result : any ) . errors  =  result . errors . map ( formatErrorFn ) ; 
366370 } 
367371
@@ -443,7 +447,8 @@ export type GraphQLParams = {|
443447module . exports . getGraphQLParams  =  getGraphQLParams ; 
444448async function  getGraphQLParams ( request : $Request ) : Promise < GraphQLParams >  { 
445449 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 )  ||  { } ; 
447452
448453 return  parseGraphQLParams ( urlData ,  bodyData ) ; 
449454} 
                         You can’t perform that action at this time. 
           
                  
0 commit comments