File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ module.exports = {
23
23
'^.+\\.ts?$' : [
24
24
'ts-jest' ,
25
25
{
26
- tsconfig : 'tsconfig.json' , // Specify your TypeScript config file
26
+ tsconfig : 'tsconfig.json' ,
27
27
} ,
28
28
] ,
29
29
} ,
Original file line number Diff line number Diff line change 1
1
import { ExecutionResult , graphql } from 'graphql' ;
2
2
import { getSchema } from '../src/services/ApolloServices/ApolloServerService' ;
3
3
4
- async function testGraphQLQuery < T > ( query : string , variables ?: Record < string , any > ) {
4
+ async function testGraphQLQuery < T > ( query : string , variables ?: Record < string , never > ) : Promise < ExecutionResult < T > > {
5
5
const schema = await getSchema ( ) ;
6
6
7
- return graphql ( {
7
+ const result : Promise < ExecutionResult < T > > = ( await graphql ( {
8
8
schema,
9
9
source : query ,
10
10
variableValues : variables ,
11
- } ) as unknown as Promise < ExecutionResult < T > > ;
11
+ } ) ) as Promise < ExecutionResult < T > > ;
12
+
13
+ return result ;
12
14
}
13
15
14
16
export { testGraphQLQuery } ;
You can’t perform that action at this time.
0 commit comments