@@ -363,7 +363,15 @@ export function createHandler<RawRequest = unknown>(
363
363
return [
364
364
err . message ,
365
365
{
366
- status : acceptedMediaType === 'application/json' ? 200 : 400 ,
366
+ ...( acceptedMediaType === 'application/json'
367
+ ? {
368
+ status : 200 ,
369
+ statusText : 'OK' ,
370
+ }
371
+ : {
372
+ status : 400 ,
373
+ statusText : 'Bad Request' ,
374
+ } ) ,
367
375
statusText : 'Bad Request' ,
368
376
} ,
369
377
] ;
@@ -385,7 +393,15 @@ export function createHandler<RawRequest = unknown>(
385
393
return [
386
394
'GraphQL query syntax error' ,
387
395
{
388
- status : acceptedMediaType === 'application/json' ? 200 : 400 ,
396
+ ...( acceptedMediaType === 'application/json'
397
+ ? {
398
+ status : 200 ,
399
+ statusText : 'OK' ,
400
+ }
401
+ : {
402
+ status : 400 ,
403
+ statusText : 'Bad Request' ,
404
+ } ) ,
389
405
statusText : 'Bad Request' ,
390
406
} ,
391
407
] ;
@@ -421,7 +437,15 @@ export function createHandler<RawRequest = unknown>(
421
437
return [
422
438
'Unable to detect operation AST' ,
423
439
{
424
- status : acceptedMediaType === 'application/json' ? 200 : 400 ,
440
+ ...( acceptedMediaType === 'application/json'
441
+ ? {
442
+ status : 200 ,
443
+ statusText : 'OK' ,
444
+ }
445
+ : {
446
+ status : 400 ,
447
+ statusText : 'Bad Request' ,
448
+ } ) ,
425
449
statusText : 'Bad Request' ,
426
450
} ,
427
451
] ;
@@ -464,8 +488,15 @@ export function createHandler<RawRequest = unknown>(
464
488
return [
465
489
JSON . stringify ( { errors : validationErrs } ) ,
466
490
{
467
- status : acceptedMediaType === 'application/json' ? 200 : 400 ,
468
- statusText : 'Bad Request' ,
491
+ ...( acceptedMediaType === 'application/json'
492
+ ? {
493
+ status : 200 ,
494
+ statusText : 'OK' ,
495
+ }
496
+ : {
497
+ status : 400 ,
498
+ statusText : 'Bad Request' ,
499
+ } ) ,
469
500
headers : {
470
501
'content-type' :
471
502
acceptedMediaType === 'application/json'
0 commit comments