File tree Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Expand file tree Collapse file tree 2 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -434,9 +434,9 @@ describe('Subscription Initialization Phase', () => {
434
434
435
435
it ( 'resolves to an error for source event stream resolver errors' , async ( ) => {
436
436
// Returning an error
437
- const subscriptionReturningErrorSchema = emailSchemaWithResolvers ( ( ) => {
438
- return new Error ( 'test error' ) ;
439
- } ) ;
437
+ const subscriptionReturningErrorSchema = emailSchemaWithResolvers (
438
+ ( ) => new Error ( 'test error' ) ,
439
+ ) ;
440
440
await testReportsError ( subscriptionReturningErrorSchema ) ;
441
441
442
442
// Throwing an error
@@ -446,10 +446,8 @@ describe('Subscription Initialization Phase', () => {
446
446
await testReportsError ( subscriptionThrowingErrorSchema ) ;
447
447
448
448
// Resolving to an error
449
- const subscriptionResolvingErrorSchema = emailSchemaWithResolvers (
450
- async ( ) => {
451
- return new Error ( 'test error' ) ;
452
- } ,
449
+ const subscriptionResolvingErrorSchema = emailSchemaWithResolvers ( ( ) =>
450
+ Promise . resolve ( new Error ( 'test error' ) ) ,
453
451
) ;
454
452
await testReportsError ( subscriptionResolvingErrorSchema ) ;
455
453
@@ -1013,6 +1011,7 @@ describe('Subscription Publish Phase', () => {
1013
1011
` ) ,
1014
1012
) ;
1015
1013
1014
+ // $FlowFixMe
1016
1015
const payload1 = await subscription . next ( ) ;
1017
1016
expect ( payload1 ) . to . deep . equal ( {
1018
1017
done : false ,
Original file line number Diff line number Diff line change @@ -151,16 +151,15 @@ function subscribeImpl(
151
151
152
152
// Resolve the Source Stream, then map every source value to a
153
153
// ExecutionResult value as described above.
154
- return sourcePromise . then (
155
- resultOrStream =>
156
- // Note: Flow can't refine isAsyncIterable, so explicit casts are used.
157
- isAsyncIterable ( resultOrStream )
158
- ? mapAsyncIterator (
159
- ( ( resultOrStream : any ) : AsyncIterable < mixed > ) ,
160
- mapSourceToResponse ,
161
- reportGraphQLError ,
162
- )
163
- : ( ( resultOrStream : any ) : ExecutionResult ) ,
154
+ return sourcePromise . then ( resultOrStream =>
155
+ // Note: Flow can't refine isAsyncIterable, so explicit casts are used.
156
+ isAsyncIterable ( resultOrStream )
157
+ ? mapAsyncIterator (
158
+ ( ( resultOrStream : any ) : AsyncIterable < mixed > ) ,
159
+ mapSourceToResponse ,
160
+ reportGraphQLError ,
161
+ )
162
+ : ( ( resultOrStream : any ) : ExecutionResult ) ,
164
163
) ;
165
164
}
166
165
You can’t perform that action at this time.
0 commit comments