@constructive-io/graphql-codegen 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1818 -113
- package/__tests__/codegen/input-types-generator.test.d.ts +1 -0
- package/__tests__/codegen/input-types-generator.test.js +635 -0
- package/cli/codegen/barrel.d.ts +27 -0
- package/cli/codegen/barrel.js +163 -0
- package/cli/codegen/client.d.ts +4 -0
- package/cli/codegen/client.js +170 -0
- package/cli/codegen/custom-mutations.d.ts +38 -0
- package/cli/codegen/custom-mutations.js +149 -0
- package/cli/codegen/custom-queries.d.ts +38 -0
- package/cli/codegen/custom-queries.js +358 -0
- package/cli/codegen/filters.d.ts +27 -0
- package/cli/codegen/filters.js +357 -0
- package/cli/codegen/gql-ast.d.ts +41 -0
- package/cli/codegen/gql-ast.js +329 -0
- package/cli/codegen/index.d.ts +71 -0
- package/cli/codegen/index.js +147 -0
- package/cli/codegen/mutations.d.ts +30 -0
- package/cli/codegen/mutations.js +410 -0
- package/cli/codegen/orm/barrel.d.ts +18 -0
- package/cli/codegen/orm/barrel.js +48 -0
- package/cli/codegen/orm/client-generator.d.ts +45 -0
- package/cli/codegen/orm/client-generator.js +646 -0
- package/cli/codegen/orm/custom-ops-generator.d.ts +30 -0
- package/cli/codegen/orm/custom-ops-generator.js +350 -0
- package/cli/codegen/orm/index.d.ts +38 -0
- package/cli/codegen/orm/index.js +88 -0
- package/cli/codegen/orm/input-types-generator.d.ts +21 -0
- package/cli/codegen/orm/input-types-generator.js +705 -0
- package/cli/codegen/orm/input-types-generator.test.d.ts +1 -0
- package/cli/codegen/orm/input-types-generator.test.js +75 -0
- package/cli/codegen/orm/model-generator.d.ts +32 -0
- package/cli/codegen/orm/model-generator.js +264 -0
- package/cli/codegen/orm/query-builder.d.ts +161 -0
- package/cli/codegen/orm/query-builder.js +366 -0
- package/cli/codegen/orm/select-types.d.ts +169 -0
- package/cli/codegen/orm/select-types.js +16 -0
- package/cli/codegen/orm/select-types.test.d.ts +11 -0
- package/cli/codegen/orm/select-types.test.js +22 -0
- package/cli/codegen/queries.d.ts +25 -0
- package/cli/codegen/queries.js +438 -0
- package/cli/codegen/scalars.d.ts +12 -0
- package/cli/codegen/scalars.js +71 -0
- package/cli/codegen/schema-gql-ast.d.ts +51 -0
- package/cli/codegen/schema-gql-ast.js +385 -0
- package/cli/codegen/ts-ast.d.ts +122 -0
- package/cli/codegen/ts-ast.js +280 -0
- package/cli/codegen/type-resolver.d.ts +96 -0
- package/cli/codegen/type-resolver.js +246 -0
- package/cli/codegen/types.d.ts +12 -0
- package/cli/codegen/types.js +69 -0
- package/cli/codegen/utils.d.ts +163 -0
- package/cli/codegen/utils.js +326 -0
- package/cli/commands/generate-orm.d.ts +37 -0
- package/cli/commands/generate-orm.js +195 -0
- package/cli/commands/generate.d.ts +39 -0
- package/cli/commands/generate.js +299 -0
- package/cli/commands/index.d.ts +7 -0
- package/cli/commands/index.js +12 -0
- package/cli/commands/init.d.ts +35 -0
- package/cli/commands/init.js +176 -0
- package/cli/index.d.ts +4 -0
- package/cli/index.js +291 -0
- package/cli/introspect/fetch-meta.d.ts +31 -0
- package/cli/introspect/fetch-meta.js +108 -0
- package/cli/introspect/fetch-schema.d.ts +21 -0
- package/cli/introspect/fetch-schema.js +86 -0
- package/cli/introspect/index.d.ts +8 -0
- package/cli/introspect/index.js +16 -0
- package/cli/introspect/meta-query.d.ts +111 -0
- package/cli/introspect/meta-query.js +191 -0
- package/cli/introspect/schema-query.d.ts +20 -0
- package/cli/introspect/schema-query.js +123 -0
- package/cli/introspect/transform-schema.d.ts +74 -0
- package/cli/introspect/transform-schema.js +269 -0
- package/cli/introspect/transform-schema.test.d.ts +1 -0
- package/cli/introspect/transform-schema.test.js +67 -0
- package/cli/introspect/transform.d.ts +21 -0
- package/cli/introspect/transform.js +216 -0
- package/cli/watch/cache.d.ts +45 -0
- package/cli/watch/cache.js +111 -0
- package/cli/watch/debounce.d.ts +19 -0
- package/cli/watch/debounce.js +89 -0
- package/cli/watch/hash.d.ts +17 -0
- package/cli/watch/hash.js +48 -0
- package/cli/watch/index.d.ts +10 -0
- package/cli/watch/index.js +22 -0
- package/cli/watch/orchestrator.d.ts +63 -0
- package/cli/watch/orchestrator.js +228 -0
- package/cli/watch/poller.d.ts +65 -0
- package/cli/watch/poller.js +203 -0
- package/cli/watch/types.d.ts +67 -0
- package/cli/watch/types.js +5 -0
- package/client/error.d.ts +95 -0
- package/client/error.js +255 -0
- package/client/execute.d.ts +57 -0
- package/client/execute.js +124 -0
- package/client/index.d.ts +6 -0
- package/client/index.js +18 -0
- package/client/typed-document.d.ts +31 -0
- package/client/typed-document.js +44 -0
- package/core/ast.d.ts +10 -0
- package/core/ast.js +593 -0
- package/core/custom-ast.d.ts +35 -0
- package/core/custom-ast.js +204 -0
- package/core/index.d.ts +8 -0
- package/core/index.js +33 -0
- package/core/meta-object/convert.d.ts +65 -0
- package/core/meta-object/convert.js +63 -0
- package/core/meta-object/format.json +93 -0
- package/core/meta-object/index.d.ts +2 -0
- package/core/meta-object/index.js +18 -0
- package/core/meta-object/validate.d.ts +9 -0
- package/core/meta-object/validate.js +34 -0
- package/core/query-builder.d.ts +46 -0
- package/core/query-builder.js +412 -0
- package/core/types.d.ts +139 -0
- package/core/types.js +28 -0
- package/esm/__tests__/codegen/input-types-generator.test.d.ts +1 -0
- package/esm/__tests__/codegen/input-types-generator.test.js +633 -0
- package/esm/cli/codegen/barrel.d.ts +27 -0
- package/esm/cli/codegen/barrel.js +156 -0
- package/esm/cli/codegen/client.d.ts +4 -0
- package/esm/cli/codegen/client.js +167 -0
- package/esm/cli/codegen/custom-mutations.d.ts +38 -0
- package/esm/cli/codegen/custom-mutations.js +145 -0
- package/esm/cli/codegen/custom-queries.d.ts +38 -0
- package/esm/cli/codegen/custom-queries.js +354 -0
- package/esm/cli/codegen/filters.d.ts +27 -0
- package/esm/cli/codegen/filters.js +351 -0
- package/esm/cli/codegen/gql-ast.d.ts +41 -0
- package/esm/cli/codegen/gql-ast.js +288 -0
- package/esm/cli/codegen/index.d.ts +71 -0
- package/esm/cli/codegen/index.js +124 -0
- package/esm/cli/codegen/mutations.d.ts +30 -0
- package/esm/cli/codegen/mutations.js +404 -0
- package/esm/cli/codegen/orm/barrel.d.ts +18 -0
- package/esm/cli/codegen/orm/barrel.js +44 -0
- package/esm/cli/codegen/orm/client-generator.d.ts +45 -0
- package/esm/cli/codegen/orm/client-generator.js +640 -0
- package/esm/cli/codegen/orm/custom-ops-generator.d.ts +30 -0
- package/esm/cli/codegen/orm/custom-ops-generator.js +346 -0
- package/esm/cli/codegen/orm/index.d.ts +38 -0
- package/esm/cli/codegen/orm/index.js +75 -0
- package/esm/cli/codegen/orm/input-types-generator.d.ts +21 -0
- package/esm/cli/codegen/orm/input-types-generator.js +700 -0
- package/esm/cli/codegen/orm/input-types-generator.test.d.ts +1 -0
- package/esm/cli/codegen/orm/input-types-generator.test.js +73 -0
- package/esm/cli/codegen/orm/model-generator.d.ts +32 -0
- package/esm/cli/codegen/orm/model-generator.js +260 -0
- package/esm/cli/codegen/orm/query-builder.d.ts +161 -0
- package/esm/cli/codegen/orm/query-builder.js +353 -0
- package/esm/cli/codegen/orm/select-types.d.ts +169 -0
- package/esm/cli/codegen/orm/select-types.js +15 -0
- package/esm/cli/codegen/orm/select-types.test.d.ts +11 -0
- package/esm/cli/codegen/orm/select-types.test.js +21 -0
- package/esm/cli/codegen/queries.d.ts +25 -0
- package/esm/cli/codegen/queries.js +433 -0
- package/esm/cli/codegen/scalars.d.ts +12 -0
- package/esm/cli/codegen/scalars.js +66 -0
- package/esm/cli/codegen/schema-gql-ast.d.ts +51 -0
- package/esm/cli/codegen/schema-gql-ast.js +343 -0
- package/esm/cli/codegen/ts-ast.d.ts +122 -0
- package/esm/cli/codegen/ts-ast.js +260 -0
- package/esm/cli/codegen/type-resolver.d.ts +96 -0
- package/esm/cli/codegen/type-resolver.js +224 -0
- package/esm/cli/codegen/types.d.ts +12 -0
- package/esm/cli/codegen/types.js +65 -0
- package/esm/cli/codegen/utils.d.ts +163 -0
- package/esm/cli/codegen/utils.js +288 -0
- package/esm/cli/commands/generate-orm.d.ts +37 -0
- package/esm/cli/commands/generate-orm.js +192 -0
- package/esm/cli/commands/generate.d.ts +39 -0
- package/esm/cli/commands/generate.js +262 -0
- package/esm/cli/commands/index.d.ts +7 -0
- package/esm/cli/commands/index.js +5 -0
- package/esm/cli/commands/init.d.ts +35 -0
- package/esm/cli/commands/init.js +138 -0
- package/esm/cli/index.d.ts +4 -0
- package/esm/cli/index.js +256 -0
- package/esm/cli/introspect/fetch-meta.d.ts +31 -0
- package/esm/cli/introspect/fetch-meta.js +104 -0
- package/esm/cli/introspect/fetch-schema.d.ts +21 -0
- package/esm/cli/introspect/fetch-schema.js +83 -0
- package/esm/cli/introspect/index.d.ts +8 -0
- package/esm/cli/introspect/index.js +6 -0
- package/esm/cli/introspect/meta-query.d.ts +111 -0
- package/esm/cli/introspect/meta-query.js +188 -0
- package/esm/cli/introspect/schema-query.d.ts +20 -0
- package/esm/cli/introspect/schema-query.js +120 -0
- package/esm/cli/introspect/transform-schema.d.ts +74 -0
- package/esm/cli/introspect/transform-schema.js +259 -0
- package/esm/cli/introspect/transform-schema.test.d.ts +1 -0
- package/esm/cli/introspect/transform-schema.test.js +65 -0
- package/esm/cli/introspect/transform.d.ts +21 -0
- package/esm/cli/introspect/transform.js +210 -0
- package/esm/cli/watch/cache.d.ts +45 -0
- package/esm/cli/watch/cache.js +73 -0
- package/esm/cli/watch/debounce.d.ts +19 -0
- package/esm/cli/watch/debounce.js +85 -0
- package/esm/cli/watch/hash.d.ts +17 -0
- package/esm/cli/watch/hash.js +43 -0
- package/esm/cli/watch/index.d.ts +10 -0
- package/esm/cli/watch/index.js +8 -0
- package/esm/cli/watch/orchestrator.d.ts +63 -0
- package/esm/cli/watch/orchestrator.js +223 -0
- package/esm/cli/watch/poller.d.ts +65 -0
- package/esm/cli/watch/poller.js +198 -0
- package/esm/cli/watch/types.d.ts +67 -0
- package/esm/cli/watch/types.js +4 -0
- package/esm/client/error.d.ts +95 -0
- package/esm/client/error.js +249 -0
- package/esm/client/execute.d.ts +57 -0
- package/esm/client/execute.js +120 -0
- package/esm/client/index.d.ts +6 -0
- package/esm/client/index.js +6 -0
- package/esm/client/typed-document.d.ts +31 -0
- package/esm/client/typed-document.js +40 -0
- package/esm/core/ast.d.ts +10 -0
- package/esm/core/ast.js +549 -0
- package/esm/core/custom-ast.d.ts +35 -0
- package/esm/core/custom-ast.js +161 -0
- package/esm/core/index.d.ts +8 -0
- package/esm/core/index.js +12 -0
- package/esm/core/meta-object/convert.d.ts +65 -0
- package/esm/core/meta-object/convert.js +60 -0
- package/esm/core/meta-object/format.json +93 -0
- package/esm/core/meta-object/index.d.ts +2 -0
- package/esm/core/meta-object/index.js +2 -0
- package/esm/core/meta-object/validate.d.ts +9 -0
- package/esm/core/meta-object/validate.js +28 -0
- package/esm/core/query-builder.d.ts +46 -0
- package/esm/core/query-builder.js +375 -0
- package/esm/core/types.d.ts +139 -0
- package/esm/core/types.js +24 -0
- package/esm/generators/field-selector.d.ts +30 -0
- package/esm/generators/field-selector.js +355 -0
- package/esm/generators/index.d.ts +6 -0
- package/esm/generators/index.js +9 -0
- package/esm/generators/mutations.d.ts +31 -0
- package/esm/generators/mutations.js +197 -0
- package/esm/generators/select.d.ts +50 -0
- package/esm/generators/select.js +636 -0
- package/esm/index.d.ts +12 -0
- package/esm/index.js +17 -3
- package/esm/react/index.d.ts +5 -0
- package/esm/react/index.js +6 -0
- package/esm/types/config.d.ts +199 -0
- package/esm/types/config.js +106 -0
- package/esm/types/index.d.ts +9 -0
- package/esm/types/index.js +4 -0
- package/esm/types/introspection.d.ts +121 -0
- package/esm/types/introspection.js +54 -0
- package/esm/types/mutation.d.ts +45 -0
- package/esm/types/mutation.js +4 -0
- package/esm/types/query.d.ts +82 -0
- package/esm/types/query.js +4 -0
- package/esm/types/schema.d.ts +253 -0
- package/esm/types/schema.js +5 -0
- package/esm/types/selection.d.ts +43 -0
- package/esm/types/selection.js +4 -0
- package/esm/utils/index.d.ts +4 -0
- package/esm/utils/index.js +4 -0
- package/generators/field-selector.d.ts +30 -0
- package/generators/field-selector.js +361 -0
- package/generators/index.d.ts +6 -0
- package/generators/index.js +27 -0
- package/generators/mutations.d.ts +31 -0
- package/generators/mutations.js +235 -0
- package/generators/select.d.ts +50 -0
- package/generators/select.js +679 -0
- package/index.d.ts +12 -3
- package/index.js +19 -3
- package/package.json +59 -38
- package/react/index.d.ts +5 -0
- package/react/index.js +9 -0
- package/types/config.d.ts +199 -0
- package/types/config.js +111 -0
- package/types/index.d.ts +9 -0
- package/types/index.js +10 -0
- package/types/introspection.d.ts +121 -0
- package/types/introspection.js +62 -0
- package/types/mutation.d.ts +45 -0
- package/types/mutation.js +5 -0
- package/types/query.d.ts +82 -0
- package/types/query.js +5 -0
- package/types/schema.d.ts +253 -0
- package/types/schema.js +6 -0
- package/types/selection.d.ts +43 -0
- package/types/selection.js +5 -0
- package/utils/index.d.ts +4 -0
- package/utils/index.js +7 -0
- package/codegen.d.ts +0 -13
- package/codegen.js +0 -293
- package/esm/codegen.js +0 -253
- package/esm/gql.js +0 -939
- package/esm/options.js +0 -27
- package/gql.d.ts +0 -188
- package/gql.js +0 -992
- package/options.d.ts +0 -45
- package/options.js +0 -31
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
import { getFilterTypeName, getOrderByTypeName, getScalarFilterType, getScalarFields, toScreamingSnake, getGeneratedFileHeader, } from './utils';
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// Base filter type definitions
|
|
4
|
+
// ============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Generate all base PostGraphile filter types
|
|
7
|
+
* These are shared across all tables
|
|
8
|
+
*/
|
|
9
|
+
export function generateBaseFilterTypes() {
|
|
10
|
+
return `${getGeneratedFileHeader('PostGraphile base filter types')}
|
|
11
|
+
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// String filters
|
|
14
|
+
// ============================================================================
|
|
15
|
+
|
|
16
|
+
export interface StringFilter {
|
|
17
|
+
isNull?: boolean;
|
|
18
|
+
equalTo?: string;
|
|
19
|
+
notEqualTo?: string;
|
|
20
|
+
distinctFrom?: string;
|
|
21
|
+
notDistinctFrom?: string;
|
|
22
|
+
in?: string[];
|
|
23
|
+
notIn?: string[];
|
|
24
|
+
lessThan?: string;
|
|
25
|
+
lessThanOrEqualTo?: string;
|
|
26
|
+
greaterThan?: string;
|
|
27
|
+
greaterThanOrEqualTo?: string;
|
|
28
|
+
includes?: string;
|
|
29
|
+
notIncludes?: string;
|
|
30
|
+
includesInsensitive?: string;
|
|
31
|
+
notIncludesInsensitive?: string;
|
|
32
|
+
startsWith?: string;
|
|
33
|
+
notStartsWith?: string;
|
|
34
|
+
startsWithInsensitive?: string;
|
|
35
|
+
notStartsWithInsensitive?: string;
|
|
36
|
+
endsWith?: string;
|
|
37
|
+
notEndsWith?: string;
|
|
38
|
+
endsWithInsensitive?: string;
|
|
39
|
+
notEndsWithInsensitive?: string;
|
|
40
|
+
like?: string;
|
|
41
|
+
notLike?: string;
|
|
42
|
+
likeInsensitive?: string;
|
|
43
|
+
notLikeInsensitive?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface StringListFilter {
|
|
47
|
+
isNull?: boolean;
|
|
48
|
+
equalTo?: string[];
|
|
49
|
+
notEqualTo?: string[];
|
|
50
|
+
distinctFrom?: string[];
|
|
51
|
+
notDistinctFrom?: string[];
|
|
52
|
+
lessThan?: string[];
|
|
53
|
+
lessThanOrEqualTo?: string[];
|
|
54
|
+
greaterThan?: string[];
|
|
55
|
+
greaterThanOrEqualTo?: string[];
|
|
56
|
+
contains?: string[];
|
|
57
|
+
containedBy?: string[];
|
|
58
|
+
overlaps?: string[];
|
|
59
|
+
anyEqualTo?: string;
|
|
60
|
+
anyNotEqualTo?: string;
|
|
61
|
+
anyLessThan?: string;
|
|
62
|
+
anyLessThanOrEqualTo?: string;
|
|
63
|
+
anyGreaterThan?: string;
|
|
64
|
+
anyGreaterThanOrEqualTo?: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// Numeric filters
|
|
69
|
+
// ============================================================================
|
|
70
|
+
|
|
71
|
+
export interface IntFilter {
|
|
72
|
+
isNull?: boolean;
|
|
73
|
+
equalTo?: number;
|
|
74
|
+
notEqualTo?: number;
|
|
75
|
+
distinctFrom?: number;
|
|
76
|
+
notDistinctFrom?: number;
|
|
77
|
+
in?: number[];
|
|
78
|
+
notIn?: number[];
|
|
79
|
+
lessThan?: number;
|
|
80
|
+
lessThanOrEqualTo?: number;
|
|
81
|
+
greaterThan?: number;
|
|
82
|
+
greaterThanOrEqualTo?: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface IntListFilter {
|
|
86
|
+
isNull?: boolean;
|
|
87
|
+
equalTo?: number[];
|
|
88
|
+
notEqualTo?: number[];
|
|
89
|
+
distinctFrom?: number[];
|
|
90
|
+
notDistinctFrom?: number[];
|
|
91
|
+
lessThan?: number[];
|
|
92
|
+
lessThanOrEqualTo?: number[];
|
|
93
|
+
greaterThan?: number[];
|
|
94
|
+
greaterThanOrEqualTo?: number[];
|
|
95
|
+
contains?: number[];
|
|
96
|
+
containedBy?: number[];
|
|
97
|
+
overlaps?: number[];
|
|
98
|
+
anyEqualTo?: number;
|
|
99
|
+
anyNotEqualTo?: number;
|
|
100
|
+
anyLessThan?: number;
|
|
101
|
+
anyLessThanOrEqualTo?: number;
|
|
102
|
+
anyGreaterThan?: number;
|
|
103
|
+
anyGreaterThanOrEqualTo?: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface FloatFilter {
|
|
107
|
+
isNull?: boolean;
|
|
108
|
+
equalTo?: number;
|
|
109
|
+
notEqualTo?: number;
|
|
110
|
+
distinctFrom?: number;
|
|
111
|
+
notDistinctFrom?: number;
|
|
112
|
+
in?: number[];
|
|
113
|
+
notIn?: number[];
|
|
114
|
+
lessThan?: number;
|
|
115
|
+
lessThanOrEqualTo?: number;
|
|
116
|
+
greaterThan?: number;
|
|
117
|
+
greaterThanOrEqualTo?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface BigIntFilter {
|
|
121
|
+
isNull?: boolean;
|
|
122
|
+
equalTo?: string;
|
|
123
|
+
notEqualTo?: string;
|
|
124
|
+
distinctFrom?: string;
|
|
125
|
+
notDistinctFrom?: string;
|
|
126
|
+
in?: string[];
|
|
127
|
+
notIn?: string[];
|
|
128
|
+
lessThan?: string;
|
|
129
|
+
lessThanOrEqualTo?: string;
|
|
130
|
+
greaterThan?: string;
|
|
131
|
+
greaterThanOrEqualTo?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface BigFloatFilter {
|
|
135
|
+
isNull?: boolean;
|
|
136
|
+
equalTo?: string;
|
|
137
|
+
notEqualTo?: string;
|
|
138
|
+
distinctFrom?: string;
|
|
139
|
+
notDistinctFrom?: string;
|
|
140
|
+
in?: string[];
|
|
141
|
+
notIn?: string[];
|
|
142
|
+
lessThan?: string;
|
|
143
|
+
lessThanOrEqualTo?: string;
|
|
144
|
+
greaterThan?: string;
|
|
145
|
+
greaterThanOrEqualTo?: string;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ============================================================================
|
|
149
|
+
// Boolean filter
|
|
150
|
+
// ============================================================================
|
|
151
|
+
|
|
152
|
+
export interface BooleanFilter {
|
|
153
|
+
isNull?: boolean;
|
|
154
|
+
equalTo?: boolean;
|
|
155
|
+
notEqualTo?: boolean;
|
|
156
|
+
distinctFrom?: boolean;
|
|
157
|
+
notDistinctFrom?: boolean;
|
|
158
|
+
in?: boolean[];
|
|
159
|
+
notIn?: boolean[];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ============================================================================
|
|
163
|
+
// UUID filter
|
|
164
|
+
// ============================================================================
|
|
165
|
+
|
|
166
|
+
export interface UUIDFilter {
|
|
167
|
+
isNull?: boolean;
|
|
168
|
+
equalTo?: string;
|
|
169
|
+
notEqualTo?: string;
|
|
170
|
+
distinctFrom?: string;
|
|
171
|
+
notDistinctFrom?: string;
|
|
172
|
+
in?: string[];
|
|
173
|
+
notIn?: string[];
|
|
174
|
+
lessThan?: string;
|
|
175
|
+
lessThanOrEqualTo?: string;
|
|
176
|
+
greaterThan?: string;
|
|
177
|
+
greaterThanOrEqualTo?: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export interface UUIDListFilter {
|
|
181
|
+
isNull?: boolean;
|
|
182
|
+
equalTo?: string[];
|
|
183
|
+
notEqualTo?: string[];
|
|
184
|
+
distinctFrom?: string[];
|
|
185
|
+
notDistinctFrom?: string[];
|
|
186
|
+
lessThan?: string[];
|
|
187
|
+
lessThanOrEqualTo?: string[];
|
|
188
|
+
greaterThan?: string[];
|
|
189
|
+
greaterThanOrEqualTo?: string[];
|
|
190
|
+
contains?: string[];
|
|
191
|
+
containedBy?: string[];
|
|
192
|
+
overlaps?: string[];
|
|
193
|
+
anyEqualTo?: string;
|
|
194
|
+
anyNotEqualTo?: string;
|
|
195
|
+
anyLessThan?: string;
|
|
196
|
+
anyLessThanOrEqualTo?: string;
|
|
197
|
+
anyGreaterThan?: string;
|
|
198
|
+
anyGreaterThanOrEqualTo?: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ============================================================================
|
|
202
|
+
// Date/Time filters
|
|
203
|
+
// ============================================================================
|
|
204
|
+
|
|
205
|
+
export interface DatetimeFilter {
|
|
206
|
+
isNull?: boolean;
|
|
207
|
+
equalTo?: string;
|
|
208
|
+
notEqualTo?: string;
|
|
209
|
+
distinctFrom?: string;
|
|
210
|
+
notDistinctFrom?: string;
|
|
211
|
+
in?: string[];
|
|
212
|
+
notIn?: string[];
|
|
213
|
+
lessThan?: string;
|
|
214
|
+
lessThanOrEqualTo?: string;
|
|
215
|
+
greaterThan?: string;
|
|
216
|
+
greaterThanOrEqualTo?: string;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface DateFilter {
|
|
220
|
+
isNull?: boolean;
|
|
221
|
+
equalTo?: string;
|
|
222
|
+
notEqualTo?: string;
|
|
223
|
+
distinctFrom?: string;
|
|
224
|
+
notDistinctFrom?: string;
|
|
225
|
+
in?: string[];
|
|
226
|
+
notIn?: string[];
|
|
227
|
+
lessThan?: string;
|
|
228
|
+
lessThanOrEqualTo?: string;
|
|
229
|
+
greaterThan?: string;
|
|
230
|
+
greaterThanOrEqualTo?: string;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface TimeFilter {
|
|
234
|
+
isNull?: boolean;
|
|
235
|
+
equalTo?: string;
|
|
236
|
+
notEqualTo?: string;
|
|
237
|
+
distinctFrom?: string;
|
|
238
|
+
notDistinctFrom?: string;
|
|
239
|
+
in?: string[];
|
|
240
|
+
notIn?: string[];
|
|
241
|
+
lessThan?: string;
|
|
242
|
+
lessThanOrEqualTo?: string;
|
|
243
|
+
greaterThan?: string;
|
|
244
|
+
greaterThanOrEqualTo?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// ============================================================================
|
|
248
|
+
// JSON filter
|
|
249
|
+
// ============================================================================
|
|
250
|
+
|
|
251
|
+
export interface JSONFilter {
|
|
252
|
+
isNull?: boolean;
|
|
253
|
+
equalTo?: unknown;
|
|
254
|
+
notEqualTo?: unknown;
|
|
255
|
+
distinctFrom?: unknown;
|
|
256
|
+
notDistinctFrom?: unknown;
|
|
257
|
+
in?: unknown[];
|
|
258
|
+
notIn?: unknown[];
|
|
259
|
+
contains?: unknown;
|
|
260
|
+
containedBy?: unknown;
|
|
261
|
+
containsKey?: string;
|
|
262
|
+
containsAllKeys?: string[];
|
|
263
|
+
containsAnyKeys?: string[];
|
|
264
|
+
}
|
|
265
|
+
`;
|
|
266
|
+
}
|
|
267
|
+
// ============================================================================
|
|
268
|
+
// Table-specific filter generators
|
|
269
|
+
// ============================================================================
|
|
270
|
+
/**
|
|
271
|
+
* Generate filter interface for a specific table
|
|
272
|
+
*/
|
|
273
|
+
export function generateTableFilter(table) {
|
|
274
|
+
const filterTypeName = getFilterTypeName(table);
|
|
275
|
+
const scalarFields = getScalarFields(table);
|
|
276
|
+
const fieldFilters = scalarFields
|
|
277
|
+
.map((field) => {
|
|
278
|
+
const filterType = getFieldFilterType(field);
|
|
279
|
+
if (!filterType)
|
|
280
|
+
return null;
|
|
281
|
+
return ` ${field.name}?: ${filterType};`;
|
|
282
|
+
})
|
|
283
|
+
.filter(Boolean)
|
|
284
|
+
.join('\n');
|
|
285
|
+
return `export interface ${filterTypeName} {
|
|
286
|
+
${fieldFilters}
|
|
287
|
+
/** Logical AND */
|
|
288
|
+
and?: ${filterTypeName}[];
|
|
289
|
+
/** Logical OR */
|
|
290
|
+
or?: ${filterTypeName}[];
|
|
291
|
+
/** Logical NOT */
|
|
292
|
+
not?: ${filterTypeName};
|
|
293
|
+
}`;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Get the filter type for a specific field
|
|
297
|
+
*/
|
|
298
|
+
function getFieldFilterType(field) {
|
|
299
|
+
const { gqlType, isArray } = field.type;
|
|
300
|
+
// Handle array types
|
|
301
|
+
if (isArray) {
|
|
302
|
+
const cleanType = gqlType.replace(/!/g, '');
|
|
303
|
+
switch (cleanType) {
|
|
304
|
+
case 'String':
|
|
305
|
+
return 'StringListFilter';
|
|
306
|
+
case 'Int':
|
|
307
|
+
return 'IntListFilter';
|
|
308
|
+
case 'UUID':
|
|
309
|
+
return 'UUIDListFilter';
|
|
310
|
+
default:
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return getScalarFilterType(gqlType);
|
|
315
|
+
}
|
|
316
|
+
// ============================================================================
|
|
317
|
+
// OrderBy enum generators
|
|
318
|
+
// ============================================================================
|
|
319
|
+
/**
|
|
320
|
+
* Generate OrderBy type for a specific table
|
|
321
|
+
*/
|
|
322
|
+
export function generateTableOrderBy(table) {
|
|
323
|
+
const orderByTypeName = getOrderByTypeName(table);
|
|
324
|
+
const scalarFields = getScalarFields(table);
|
|
325
|
+
const fieldOrderBys = scalarFields.flatMap((field) => {
|
|
326
|
+
const screamingName = toScreamingSnake(field.name);
|
|
327
|
+
return [`'${screamingName}_ASC'`, `'${screamingName}_DESC'`];
|
|
328
|
+
});
|
|
329
|
+
// Add standard PostGraphile order options
|
|
330
|
+
const standardOrderBys = [
|
|
331
|
+
"'NATURAL'",
|
|
332
|
+
"'PRIMARY_KEY_ASC'",
|
|
333
|
+
"'PRIMARY_KEY_DESC'",
|
|
334
|
+
];
|
|
335
|
+
const allOrderBys = [...fieldOrderBys, ...standardOrderBys];
|
|
336
|
+
return `export type ${orderByTypeName} = ${allOrderBys.join(' | ')};`;
|
|
337
|
+
}
|
|
338
|
+
// ============================================================================
|
|
339
|
+
// Combined generators for hook files
|
|
340
|
+
// ============================================================================
|
|
341
|
+
/**
|
|
342
|
+
* Generate inline filter and orderBy types for a query hook file
|
|
343
|
+
* These are embedded directly in the hook file for self-containment
|
|
344
|
+
*/
|
|
345
|
+
export function generateInlineFilterTypes(table) {
|
|
346
|
+
const filterDef = generateTableFilter(table);
|
|
347
|
+
const orderByDef = generateTableOrderBy(table);
|
|
348
|
+
return `${filterDef}
|
|
349
|
+
|
|
350
|
+
${orderByDef}`;
|
|
351
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DocumentNode } from 'graphql';
|
|
2
|
+
import type { CleanTable } from '../../types/schema';
|
|
3
|
+
export interface ListQueryConfig {
|
|
4
|
+
table: CleanTable;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Build a list query AST for a table
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildListQueryAST(config: ListQueryConfig): DocumentNode;
|
|
10
|
+
export interface SingleQueryConfig {
|
|
11
|
+
table: CleanTable;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Build a single item query AST for a table
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildSingleQueryAST(config: SingleQueryConfig): DocumentNode;
|
|
17
|
+
export interface CreateMutationConfig {
|
|
18
|
+
table: CleanTable;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build a create mutation AST for a table
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildCreateMutationAST(config: CreateMutationConfig): DocumentNode;
|
|
24
|
+
export interface UpdateMutationConfig {
|
|
25
|
+
table: CleanTable;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build an update mutation AST for a table
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildUpdateMutationAST(config: UpdateMutationConfig): DocumentNode;
|
|
31
|
+
export interface DeleteMutationConfig {
|
|
32
|
+
table: CleanTable;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build a delete mutation AST for a table
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildDeleteMutationAST(config: DeleteMutationConfig): DocumentNode;
|
|
38
|
+
/**
|
|
39
|
+
* Print AST to GraphQL string
|
|
40
|
+
*/
|
|
41
|
+
export declare function printGraphQL(ast: DocumentNode): string;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL AST builders using gql-ast
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for generating GraphQL queries and mutations via AST
|
|
5
|
+
* instead of string concatenation.
|
|
6
|
+
*/
|
|
7
|
+
import * as t from 'gql-ast';
|
|
8
|
+
import { print } from 'graphql';
|
|
9
|
+
import { getTableNames, getAllRowsQueryName, getSingleRowQueryName, getCreateMutationName, getUpdateMutationName, getDeleteMutationName, getFilterTypeName, getOrderByTypeName, getScalarFields, ucFirst, } from './utils';
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Field selection builders
|
|
12
|
+
// ============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Create field selections from CleanField array
|
|
15
|
+
*/
|
|
16
|
+
function createFieldSelections(fields) {
|
|
17
|
+
return fields.map((field) => t.field({ name: field.name }));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create pageInfo selection
|
|
21
|
+
*/
|
|
22
|
+
function createPageInfoSelection() {
|
|
23
|
+
return t.field({
|
|
24
|
+
name: 'pageInfo',
|
|
25
|
+
selectionSet: t.selectionSet({
|
|
26
|
+
selections: [
|
|
27
|
+
t.field({ name: 'hasNextPage' }),
|
|
28
|
+
t.field({ name: 'hasPreviousPage' }),
|
|
29
|
+
t.field({ name: 'startCursor' }),
|
|
30
|
+
t.field({ name: 'endCursor' }),
|
|
31
|
+
],
|
|
32
|
+
}),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build a list query AST for a table
|
|
37
|
+
*/
|
|
38
|
+
export function buildListQueryAST(config) {
|
|
39
|
+
const { table } = config;
|
|
40
|
+
const queryName = getAllRowsQueryName(table);
|
|
41
|
+
const filterType = getFilterTypeName(table);
|
|
42
|
+
const orderByType = getOrderByTypeName(table);
|
|
43
|
+
const scalarFields = getScalarFields(table);
|
|
44
|
+
// Variable definitions
|
|
45
|
+
const variableDefinitions = [
|
|
46
|
+
t.variableDefinition({
|
|
47
|
+
variable: t.variable({ name: 'first' }),
|
|
48
|
+
type: t.namedType({ type: 'Int' }),
|
|
49
|
+
}),
|
|
50
|
+
t.variableDefinition({
|
|
51
|
+
variable: t.variable({ name: 'offset' }),
|
|
52
|
+
type: t.namedType({ type: 'Int' }),
|
|
53
|
+
}),
|
|
54
|
+
t.variableDefinition({
|
|
55
|
+
variable: t.variable({ name: 'filter' }),
|
|
56
|
+
type: t.namedType({ type: filterType }),
|
|
57
|
+
}),
|
|
58
|
+
t.variableDefinition({
|
|
59
|
+
variable: t.variable({ name: 'orderBy' }),
|
|
60
|
+
type: t.listType({
|
|
61
|
+
type: t.nonNullType({ type: t.namedType({ type: orderByType }) }),
|
|
62
|
+
}),
|
|
63
|
+
}),
|
|
64
|
+
];
|
|
65
|
+
// Query arguments
|
|
66
|
+
const args = [
|
|
67
|
+
t.argument({ name: 'first', value: t.variable({ name: 'first' }) }),
|
|
68
|
+
t.argument({ name: 'offset', value: t.variable({ name: 'offset' }) }),
|
|
69
|
+
t.argument({ name: 'filter', value: t.variable({ name: 'filter' }) }),
|
|
70
|
+
t.argument({ name: 'orderBy', value: t.variable({ name: 'orderBy' }) }),
|
|
71
|
+
];
|
|
72
|
+
// Field selections
|
|
73
|
+
const fieldSelections = createFieldSelections(scalarFields);
|
|
74
|
+
// Connection fields
|
|
75
|
+
const connectionFields = [
|
|
76
|
+
t.field({ name: 'totalCount' }),
|
|
77
|
+
t.field({
|
|
78
|
+
name: 'nodes',
|
|
79
|
+
selectionSet: t.selectionSet({ selections: fieldSelections }),
|
|
80
|
+
}),
|
|
81
|
+
createPageInfoSelection(),
|
|
82
|
+
];
|
|
83
|
+
return t.document({
|
|
84
|
+
definitions: [
|
|
85
|
+
t.operationDefinition({
|
|
86
|
+
operation: 'query',
|
|
87
|
+
name: `${ucFirst(queryName)}Query`,
|
|
88
|
+
variableDefinitions,
|
|
89
|
+
selectionSet: t.selectionSet({
|
|
90
|
+
selections: [
|
|
91
|
+
t.field({
|
|
92
|
+
name: queryName,
|
|
93
|
+
args,
|
|
94
|
+
selectionSet: t.selectionSet({ selections: connectionFields }),
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
}),
|
|
98
|
+
}),
|
|
99
|
+
],
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Build a single item query AST for a table
|
|
104
|
+
*/
|
|
105
|
+
export function buildSingleQueryAST(config) {
|
|
106
|
+
const { table } = config;
|
|
107
|
+
const queryName = getSingleRowQueryName(table);
|
|
108
|
+
const scalarFields = getScalarFields(table);
|
|
109
|
+
// Variable definitions - assume UUID primary key
|
|
110
|
+
const variableDefinitions = [
|
|
111
|
+
t.variableDefinition({
|
|
112
|
+
variable: t.variable({ name: 'id' }),
|
|
113
|
+
type: t.nonNullType({ type: t.namedType({ type: 'UUID' }) }),
|
|
114
|
+
}),
|
|
115
|
+
];
|
|
116
|
+
// Query arguments
|
|
117
|
+
const args = [
|
|
118
|
+
t.argument({ name: 'id', value: t.variable({ name: 'id' }) }),
|
|
119
|
+
];
|
|
120
|
+
// Field selections
|
|
121
|
+
const fieldSelections = createFieldSelections(scalarFields);
|
|
122
|
+
return t.document({
|
|
123
|
+
definitions: [
|
|
124
|
+
t.operationDefinition({
|
|
125
|
+
operation: 'query',
|
|
126
|
+
name: `${ucFirst(queryName)}Query`,
|
|
127
|
+
variableDefinitions,
|
|
128
|
+
selectionSet: t.selectionSet({
|
|
129
|
+
selections: [
|
|
130
|
+
t.field({
|
|
131
|
+
name: queryName,
|
|
132
|
+
args,
|
|
133
|
+
selectionSet: t.selectionSet({ selections: fieldSelections }),
|
|
134
|
+
}),
|
|
135
|
+
],
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
138
|
+
],
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Build a create mutation AST for a table
|
|
143
|
+
*/
|
|
144
|
+
export function buildCreateMutationAST(config) {
|
|
145
|
+
const { table } = config;
|
|
146
|
+
const { typeName, singularName } = getTableNames(table);
|
|
147
|
+
const mutationName = getCreateMutationName(table);
|
|
148
|
+
const inputTypeName = `Create${typeName}Input`;
|
|
149
|
+
const scalarFields = getScalarFields(table);
|
|
150
|
+
// Variable definitions
|
|
151
|
+
const variableDefinitions = [
|
|
152
|
+
t.variableDefinition({
|
|
153
|
+
variable: t.variable({ name: 'input' }),
|
|
154
|
+
type: t.nonNullType({ type: t.namedType({ type: inputTypeName }) }),
|
|
155
|
+
}),
|
|
156
|
+
];
|
|
157
|
+
// Mutation arguments
|
|
158
|
+
const args = [
|
|
159
|
+
t.argument({ name: 'input', value: t.variable({ name: 'input' }) }),
|
|
160
|
+
];
|
|
161
|
+
// Field selections
|
|
162
|
+
const fieldSelections = createFieldSelections(scalarFields);
|
|
163
|
+
return t.document({
|
|
164
|
+
definitions: [
|
|
165
|
+
t.operationDefinition({
|
|
166
|
+
operation: 'mutation',
|
|
167
|
+
name: `${ucFirst(mutationName)}Mutation`,
|
|
168
|
+
variableDefinitions,
|
|
169
|
+
selectionSet: t.selectionSet({
|
|
170
|
+
selections: [
|
|
171
|
+
t.field({
|
|
172
|
+
name: mutationName,
|
|
173
|
+
args,
|
|
174
|
+
selectionSet: t.selectionSet({
|
|
175
|
+
selections: [
|
|
176
|
+
t.field({
|
|
177
|
+
name: singularName,
|
|
178
|
+
selectionSet: t.selectionSet({ selections: fieldSelections }),
|
|
179
|
+
}),
|
|
180
|
+
],
|
|
181
|
+
}),
|
|
182
|
+
}),
|
|
183
|
+
],
|
|
184
|
+
}),
|
|
185
|
+
}),
|
|
186
|
+
],
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Build an update mutation AST for a table
|
|
191
|
+
*/
|
|
192
|
+
export function buildUpdateMutationAST(config) {
|
|
193
|
+
const { table } = config;
|
|
194
|
+
const { typeName, singularName } = getTableNames(table);
|
|
195
|
+
const mutationName = getUpdateMutationName(table);
|
|
196
|
+
const inputTypeName = `Update${typeName}Input`;
|
|
197
|
+
const scalarFields = getScalarFields(table);
|
|
198
|
+
// Variable definitions
|
|
199
|
+
const variableDefinitions = [
|
|
200
|
+
t.variableDefinition({
|
|
201
|
+
variable: t.variable({ name: 'input' }),
|
|
202
|
+
type: t.nonNullType({ type: t.namedType({ type: inputTypeName }) }),
|
|
203
|
+
}),
|
|
204
|
+
];
|
|
205
|
+
// Mutation arguments
|
|
206
|
+
const args = [
|
|
207
|
+
t.argument({ name: 'input', value: t.variable({ name: 'input' }) }),
|
|
208
|
+
];
|
|
209
|
+
// Field selections
|
|
210
|
+
const fieldSelections = createFieldSelections(scalarFields);
|
|
211
|
+
return t.document({
|
|
212
|
+
definitions: [
|
|
213
|
+
t.operationDefinition({
|
|
214
|
+
operation: 'mutation',
|
|
215
|
+
name: `${ucFirst(mutationName)}Mutation`,
|
|
216
|
+
variableDefinitions,
|
|
217
|
+
selectionSet: t.selectionSet({
|
|
218
|
+
selections: [
|
|
219
|
+
t.field({
|
|
220
|
+
name: mutationName,
|
|
221
|
+
args,
|
|
222
|
+
selectionSet: t.selectionSet({
|
|
223
|
+
selections: [
|
|
224
|
+
t.field({
|
|
225
|
+
name: singularName,
|
|
226
|
+
selectionSet: t.selectionSet({ selections: fieldSelections }),
|
|
227
|
+
}),
|
|
228
|
+
],
|
|
229
|
+
}),
|
|
230
|
+
}),
|
|
231
|
+
],
|
|
232
|
+
}),
|
|
233
|
+
}),
|
|
234
|
+
],
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Build a delete mutation AST for a table
|
|
239
|
+
*/
|
|
240
|
+
export function buildDeleteMutationAST(config) {
|
|
241
|
+
const { table } = config;
|
|
242
|
+
const { typeName } = getTableNames(table);
|
|
243
|
+
const mutationName = getDeleteMutationName(table);
|
|
244
|
+
const inputTypeName = `Delete${typeName}Input`;
|
|
245
|
+
// Variable definitions
|
|
246
|
+
const variableDefinitions = [
|
|
247
|
+
t.variableDefinition({
|
|
248
|
+
variable: t.variable({ name: 'input' }),
|
|
249
|
+
type: t.nonNullType({ type: t.namedType({ type: inputTypeName }) }),
|
|
250
|
+
}),
|
|
251
|
+
];
|
|
252
|
+
// Mutation arguments
|
|
253
|
+
const args = [
|
|
254
|
+
t.argument({ name: 'input', value: t.variable({ name: 'input' }) }),
|
|
255
|
+
];
|
|
256
|
+
return t.document({
|
|
257
|
+
definitions: [
|
|
258
|
+
t.operationDefinition({
|
|
259
|
+
operation: 'mutation',
|
|
260
|
+
name: `${ucFirst(mutationName)}Mutation`,
|
|
261
|
+
variableDefinitions,
|
|
262
|
+
selectionSet: t.selectionSet({
|
|
263
|
+
selections: [
|
|
264
|
+
t.field({
|
|
265
|
+
name: mutationName,
|
|
266
|
+
args,
|
|
267
|
+
selectionSet: t.selectionSet({
|
|
268
|
+
selections: [
|
|
269
|
+
t.field({ name: 'clientMutationId' }),
|
|
270
|
+
t.field({ name: 'deletedId' }),
|
|
271
|
+
],
|
|
272
|
+
}),
|
|
273
|
+
}),
|
|
274
|
+
],
|
|
275
|
+
}),
|
|
276
|
+
}),
|
|
277
|
+
],
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// ============================================================================
|
|
281
|
+
// Print utilities
|
|
282
|
+
// ============================================================================
|
|
283
|
+
/**
|
|
284
|
+
* Print AST to GraphQL string
|
|
285
|
+
*/
|
|
286
|
+
export function printGraphQL(ast) {
|
|
287
|
+
return print(ast);
|
|
288
|
+
}
|