-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.ts
More file actions
57 lines (49 loc) · 1.68 KB
/
types.ts
File metadata and controls
57 lines (49 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import type { GraphileOptions } from '@pgpmjs/types';
import { DocumentNode, GraphQLError } from 'graphql';
export interface GraphQLQueryOptions<TVariables = Record<string, any>> {
query: string | DocumentNode;
variables?: TVariables;
commit?: boolean;
reqOptions?: Record<string, any>;
}
export interface GraphQLTestContext {
setup: () => Promise<void>;
teardown: () => Promise<void>;
query: <TResult = any, TVariables = Record<string, any>>(
opts: GraphQLQueryOptions<TVariables>
) => Promise<TResult>;
}
export interface GetConnectionsInput {
useRoot?: boolean;
schemas: string[];
authRole?: string;
graphile?: GraphileOptions;
}
export interface GraphQLQueryOptions<TVariables = Record<string, any>> {
query: string | DocumentNode;
variables?: TVariables;
commit?: boolean;
reqOptions?: Record<string, any>;
}
export interface GraphQLResponse<T> {
data?: T;
errors?: readonly GraphQLError[];
}
export type GraphQLQueryFnObj = <TResult = any, TVariables = Record<string, any>>(
opts: GraphQLQueryOptions<TVariables>
) => Promise<GraphQLResponse<TResult>>;
export type GraphQLQueryFn = <TResult = any, TVariables = Record<string, any>>(
query: string | DocumentNode,
variables?: TVariables,
commit?: boolean,
reqOptions?: Record<string, any>
) => Promise<GraphQLResponse<TResult>>;
export type GraphQLQueryUnwrappedFnObj = <TResult = any, TVariables = Record<string, any>>(
opts: GraphQLQueryOptions<TVariables>
) => Promise<TResult>;
export type GraphQLQueryUnwrappedFn = <TResult = any, TVariables = Record<string, any>>(
query: string | DocumentNode,
variables?: TVariables,
commit?: boolean,
reqOptions?: Record<string, any>
) => Promise<TResult>;