File tree Expand file tree Collapse file tree 1 file changed +17
-15
lines changed
Expand file tree Collapse file tree 1 file changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,23 @@ function delay(wait) {
1010}
1111
1212const staticDataLink = new ApolloLink ( ( operation ) => {
13- return new Observable ( async ( observer ) => {
14- const { query, operationName, variables } = operation ;
15- await delay ( 300 ) ;
16- try {
17- const result = await graphql ( {
18- schema,
19- source : print ( query ) ,
20- variableValues : variables ,
21- operationName,
22- } ) ;
23- observer . next ( result ) ;
24- observer . complete ( ) ;
25- } catch ( err ) {
26- observer . error ( err ) ;
27- }
13+ return new Observable ( ( observer ) => {
14+ Promise . resolve ( ) . then ( async ( ) => {
15+ const { query, operationName, variables } = operation ;
16+ await delay ( 300 ) ;
17+ try {
18+ const result = await graphql ( {
19+ schema,
20+ source : print ( query ) ,
21+ variableValues : variables ,
22+ operationName,
23+ } ) ;
24+ observer . next ( result ) ;
25+ observer . complete ( ) ;
26+ } catch ( err ) {
27+ observer . error ( err ) ;
28+ }
29+ } ) ;
2830 } ) ;
2931} ) ;
3032
You can’t perform that action at this time.
0 commit comments