-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathadapter.ts
40 lines (29 loc) · 869 Bytes
/
adapter.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
import Model from "../orm/model";
export enum ConnectionMode {
AUTO,
PLAIN,
NODES,
EDGES,
ITEMS
}
export enum ArgumentMode {
TYPE,
LIST
}
export default interface Adapter {
getRootQueryName(): string;
getRootMutationName(): string;
getNameForPersist(model: Model): string;
getNameForPush(model: Model): string;
getNameForDestroy(model: Model): string;
getNameForFetch(model: Model, plural: boolean): string;
getConnectionMode(): ConnectionMode;
getArgumentMode(): ArgumentMode;
getFilterTypeName(model: Model): string;
getInputTypeName(model: Model, action?: string): string;
prepareSchemaTypeName(name: string): string;
getNameForArgumentFilter(): string;
shouldQueryAlwaysUsePluralStyle(): boolean;
shouldMutationAlwaysUsePluralStyle(): boolean;
shouldTryPluralNameIfSchemaNameNotFoundWithSingular(): boolean;
}