quicktype-graphql-input 24.0.2 → 25.0.0-pre1
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/dist/index.js +6 -6
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -123,9 +123,7 @@ function hasOptionalDirectives(directives) {
|
|
|
123
123
|
return false;
|
|
124
124
|
}
|
|
125
125
|
function expandSelectionSet(selectionSet, inType, optional) {
|
|
126
|
-
return [...selectionSet.selections]
|
|
127
|
-
.reverse()
|
|
128
|
-
.map((s) => ({
|
|
126
|
+
return [...selectionSet.selections].reverse().map((s) => ({
|
|
129
127
|
selection: s,
|
|
130
128
|
inType,
|
|
131
129
|
optional: optional || hasOptionalDirectives(s.directives),
|
|
@@ -148,7 +146,7 @@ class GQLQuery {
|
|
|
148
146
|
return (0, quicktype_core_1.panic)("No selection set on object or interface");
|
|
149
147
|
}
|
|
150
148
|
return makeNullable(builder, this.makeIRTypeFromSelectionSet(builder, fieldNode.selectionSet, fieldType, fieldNode.name.value, containingTypeName), fieldNode.name.value, null, containingTypeName);
|
|
151
|
-
case GraphQLSchema_1.TypeKind.ENUM:
|
|
149
|
+
case GraphQLSchema_1.TypeKind.ENUM: {
|
|
152
150
|
if (!fieldType.enumValues) {
|
|
153
151
|
return (0, quicktype_core_1.panic)("Enum type doesn't have values");
|
|
154
152
|
}
|
|
@@ -166,6 +164,7 @@ class GQLQuery {
|
|
|
166
164
|
optional = true;
|
|
167
165
|
result = builder.getEnumType(makeNames(name, fieldName, containingTypeName), new Set(values));
|
|
168
166
|
break;
|
|
167
|
+
}
|
|
169
168
|
case GraphQLSchema_1.TypeKind.INPUT_OBJECT:
|
|
170
169
|
// FIXME: Support input objects
|
|
171
170
|
return (0, quicktype_core_1.panic)("Input objects not supported");
|
|
@@ -214,7 +213,7 @@ class GQLQuery {
|
|
|
214
213
|
break;
|
|
215
214
|
const { selection, optional, inType } = nextItem;
|
|
216
215
|
switch (selection.kind) {
|
|
217
|
-
case graphql_1.Kind.FIELD:
|
|
216
|
+
case graphql_1.Kind.FIELD: {
|
|
218
217
|
const fieldName = selection.name.value;
|
|
219
218
|
const givenName = selection.alias
|
|
220
219
|
? selection.alias.value
|
|
@@ -223,6 +222,7 @@ class GQLQuery {
|
|
|
223
222
|
const fieldType = this.makeIRTypeFromFieldNode(builder, selection, field.type, nameOrOverride);
|
|
224
223
|
properties.set(givenName, builder.makeClassProperty(fieldType, optional));
|
|
225
224
|
break;
|
|
225
|
+
}
|
|
226
226
|
case graphql_1.Kind.FRAGMENT_SPREAD: {
|
|
227
227
|
const fragment = this.getFragment(selection.name.value);
|
|
228
228
|
const fragmentType = this._schema.types[fragment.typeCondition.name.value];
|
|
@@ -263,7 +263,7 @@ class GQLQuery {
|
|
|
263
263
|
this._fragments[def.name.value] = def;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
(0, quicktype_core_1.messageAssert)(queries.length
|
|
266
|
+
(0, quicktype_core_1.messageAssert)(queries.length > 0, "GraphQLNoQueriesDefined", {});
|
|
267
267
|
this.queries = queries;
|
|
268
268
|
}
|
|
269
269
|
makeType(builder, query, queryName) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quicktype-graphql-input",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-pre1",
|
|
4
4
|
"package": "Package for using GraphQL as an input language to quicktype",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"build": "node ../../node_modules/typescript/bin/tsc"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"quicktype-core": "
|
|
17
|
+
"quicktype-core": "25.0.0-pre1",
|
|
18
18
|
"collection-utils": "^1.0.1",
|
|
19
19
|
"graphql": "^16.11.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/node": "~20.19.0",
|
|
23
|
-
"typescript": "~
|
|
23
|
+
"typescript": "~7.0.2"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|