@@ -22,11 +22,11 @@ interface IQuery {
22
22
23
23
const Context = createContext < IGraphqlBatcher | undefined > ( undefined ) ;
24
24
25
- const coreExecutor : AsyncExecutor = async ( { document, variables } ) => {
25
+ const fetch = async ( url , document , variables ) => {
26
26
try {
27
27
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
28
28
//@ts -ignore
29
- const result = request ( getGraphqlUrl ( false ) , document , variables ) . then ( ( res ) => ( {
29
+ const result = request ( url , document , variables ) . then ( ( res ) => ( {
30
30
data : res ,
31
31
} ) ) as Promise < ExecutionResult > ;
32
32
@@ -38,20 +38,12 @@ const coreExecutor: AsyncExecutor = async ({ document, variables }) => {
38
38
}
39
39
} ;
40
40
41
- const dtrExecutor : AsyncExecutor = async ( { document, variables } ) => {
42
- try {
43
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
44
- //@ts -ignore
45
- const result = request ( getGraphqlUrl ( true ) , document , variables ) . then ( ( res ) => ( {
46
- data : res ,
47
- } ) ) as Promise < ExecutionResult > ;
41
+ const coreExecutor : AsyncExecutor = async ( { document, variables } ) => {
42
+ return fetch ( getGraphqlUrl ( false ) , document , variables ) ;
43
+ } ;
48
44
49
- return result ;
50
- } catch ( error ) {
51
- console . error ( "Graph error: " , { error } ) ;
52
- debounceErrorToast ( "Graph query error: failed to fetch data." ) ;
53
- return { data : { } } ;
54
- }
45
+ const dtrExecutor : AsyncExecutor = async ( { document, variables } ) => {
46
+ return fetch ( getGraphqlUrl ( true ) , document , variables ) ;
55
47
} ;
56
48
57
49
const coreBatchExec = createBatchingExecutor ( coreExecutor ) ;
0 commit comments