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 {
15
15
this . _patches = [ ] ;
16
16
}
17
17
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 ;
34
22
}
23
+ return Promise . resolve ( data ) ;
35
24
}
36
25
37
26
add (
@@ -41,7 +30,7 @@ export class Dispatcher {
41
30
errors : Array < GraphQLError > ,
42
31
) {
43
32
this . _patches . push (
44
- this . execute ( fn , errors ) . then ( data => ( {
33
+ this . execute ( fn ) . then ( data => ( {
45
34
value : {
46
35
data,
47
36
path : pathToArray ( path ) ,
You can’t perform that action at this time.
0 commit comments