-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
72 lines (62 loc) · 1.65 KB
/
index.d.ts
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
declare module 'oriql' {
import { GraphQLScalarType, GraphQLArgument, GraphQLSchema } from 'graphql';
type SchemaValue = GraphQLScalarType | GraphQLScalarType[] | SchemaObject | SchemaObject[];
interface GraphQLArguments {
[key: string]: SchemaValue;
name?: string;
defaultValue?: any;
description?: string;
deprecationReason?: string;
}
interface GraphQLOptions {
args?: GraphQLArguments;
name?: string;
description?: string;
}
interface SchemaSource {
name: string;
args?: GraphQLArguments;
interceptor?: () => any | Promise<any>;
transformer?: () => any | Promise<any>;
resolver: () => any | Promise<any>;
schema: OriqlSchema | OriqlSchema[];
}
interface SchemaObject {
type?: GraphQLPrimitiveType;
required?: boolean;
source?: SchemaSource;
graphql?: GraphQLOptions;
schema?: SchemaObject | SchemaObject[];
}
interface OriqlSchema {
[key: string]: SchemaValue;
}
interface OriqlSchemaMutation {
[key: string]: SchemaSource;
}
interface OriqlSchemaObject {
name: string;
instances: string[];
desciption?: string;
args?: GraphQLArguments;
schema: OriqlSchema;
mutation?: OriqlSchemaMutation;
}
export interface CompileConfig {
client?: boolean;
defaultResolver?: () => any;
pattern?: string;
schema?: OriqlSchemaObject[];
server?: boolean;
typescript?: boolean;
flow?: boolean;
external?: boolean;
}
export interface CompiledSchema {
client: string;
server: string | GraphQLSchema;
typescript: string;
flow: string;
}
export function compile(config: CompileConfig): CompiledSchema;
}