File tree Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Expand file tree Collapse file tree 1 file changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -15,23 +15,12 @@ export class Dispatcher {
1515 this . _patches = [ ] ;
1616 }
1717
18- execute (
19- fn : ( ) = > PromiseOrValue < mixed > ,
20- errors : Array < GraphQLError > ,
21- ) : Promise < mixed > {
22- try {
23- const data = fn ( ) ;
24- if ( isPromise ( data ) ) {
25- return data . then ( undefined , error => {
26- errors . push ( error ) ;
27- return Promise . resolve ( null ) ;
28- } ) ;
29- }
30- return Promise . resolve ( data ) ;
31- } catch ( error ) {
32- errors . push ( error ) ;
33- return Promise . resolve ( null ) ;
18+ execute ( fn : ( ) = > PromiseOrValue < mixed > ) : Promise < mixed > {
19+ const data = fn ( ) ;
20+ if ( isPromise ( data ) ) {
21+ return data ;
3422 }
23+ return Promise . resolve ( data ) ;
3524 }
3625
3726 add (
@@ -41,7 +30,7 @@ export class Dispatcher {
4130 errors : Array < GraphQLError > ,
4231 ) {
4332 this . _patches . push (
44- this . execute ( fn , errors ) . then ( data => ( {
33+ this . execute ( fn ) . then ( data => ( {
4534 value : {
4635 data,
4736 path : pathToArray ( path ) ,
You can’t perform that action at this time.
0 commit comments