File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,7 @@ describe('Subscription Initialization Phase', () => {
427
427
428
428
const result = subscribe ( { schema, document } ) ;
429
429
expectJSON ( result ) . toDeepEqual ( {
430
+ data : null ,
430
431
errors : [
431
432
{
432
433
message :
@@ -451,6 +452,7 @@ describe('Subscription Initialization Phase', () => {
451
452
452
453
const result = subscribe ( { schema, document } ) ;
453
454
expectJSON ( result ) . toDeepEqual ( {
455
+ data : null ,
454
456
errors : [
455
457
{
456
458
message : 'The subscription field "unknownField" is not defined.' ,
@@ -477,6 +479,7 @@ describe('Subscription Initialization Phase', () => {
477
479
478
480
it ( 'throws an error if subscribe does not return an iterator' , async ( ) => {
479
481
const expectedResult = {
482
+ data : null ,
480
483
errors : [
481
484
{
482
485
message :
@@ -498,6 +501,7 @@ describe('Subscription Initialization Phase', () => {
498
501
499
502
it ( 'resolves to an error for subscription resolver errors' , async ( ) => {
500
503
const expectedResult = {
504
+ data : null ,
501
505
errors : [
502
506
{
503
507
message : 'test error' ,
Original file line number Diff line number Diff line change @@ -1141,12 +1141,15 @@ export function createSourceEventStream(
1141
1141
try {
1142
1142
const eventStream = executeSubscription ( exeContext ) ;
1143
1143
if ( isPromise ( eventStream ) ) {
1144
- return eventStream . then ( undefined , ( error ) => ( { errors : [ error ] } ) ) ;
1144
+ return eventStream . then ( undefined , ( error ) => ( {
1145
+ data : null ,
1146
+ errors : [ error ] ,
1147
+ } ) ) ;
1145
1148
}
1146
1149
1147
1150
return eventStream ;
1148
1151
} catch ( error ) {
1149
- return { errors : [ error ] } ;
1152
+ return { data : null , errors : [ error ] } ;
1150
1153
}
1151
1154
}
1152
1155
You can’t perform that action at this time.
0 commit comments