quicktype-graphql-input 23.3.22 → 23.3.24
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 +5 -4
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.GraphQLInput = void 0;
|
|
46
46
|
const collection_utils_1 = require("collection-utils");
|
|
47
|
+
const graphql_1 = require("graphql");
|
|
47
48
|
const graphql = __importStar(require("graphql/language"));
|
|
48
49
|
const quicktype_core_1 = require("quicktype-core");
|
|
49
50
|
const GraphQLSchema_1 = require("./GraphQLSchema");
|
|
@@ -122,7 +123,7 @@ function hasOptionalDirectives(directives) {
|
|
|
122
123
|
return false;
|
|
123
124
|
}
|
|
124
125
|
function expandSelectionSet(selectionSet, inType, optional) {
|
|
125
|
-
return selectionSet.selections
|
|
126
|
+
return [...selectionSet.selections]
|
|
126
127
|
.reverse()
|
|
127
128
|
.map((s) => ({
|
|
128
129
|
selection: s,
|
|
@@ -213,7 +214,7 @@ class GQLQuery {
|
|
|
213
214
|
break;
|
|
214
215
|
const { selection, optional, inType } = nextItem;
|
|
215
216
|
switch (selection.kind) {
|
|
216
|
-
case
|
|
217
|
+
case graphql_1.Kind.FIELD:
|
|
217
218
|
const fieldName = selection.name.value;
|
|
218
219
|
const givenName = selection.alias
|
|
219
220
|
? selection.alias.value
|
|
@@ -222,7 +223,7 @@ class GQLQuery {
|
|
|
222
223
|
const fieldType = this.makeIRTypeFromFieldNode(builder, selection, field.type, nameOrOverride);
|
|
223
224
|
properties.set(givenName, builder.makeClassProperty(fieldType, optional));
|
|
224
225
|
break;
|
|
225
|
-
case
|
|
226
|
+
case graphql_1.Kind.FRAGMENT_SPREAD: {
|
|
226
227
|
const fragment = this.getFragment(selection.name.value);
|
|
227
228
|
const fragmentType = this._schema.types[fragment.typeCondition.name.value];
|
|
228
229
|
const fragmentOptional = optional || fragmentType.name !== inType.name;
|
|
@@ -230,7 +231,7 @@ class GQLQuery {
|
|
|
230
231
|
selections = selections.concat(expanded);
|
|
231
232
|
break;
|
|
232
233
|
}
|
|
233
|
-
case
|
|
234
|
+
case graphql_1.Kind.INLINE_FRAGMENT: {
|
|
234
235
|
// FIXME: support type conditions with discriminated unions
|
|
235
236
|
const fragmentType = selection.typeCondition
|
|
236
237
|
? this._schema.types[selection.typeCondition.name.value]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quicktype-graphql-input",
|
|
3
|
-
"version": "23.3.
|
|
3
|
+
"version": "23.3.24",
|
|
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",
|
|
@@ -11,13 +11,12 @@
|
|
|
11
11
|
"build": "tsc"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"quicktype-core": "23.3.
|
|
14
|
+
"quicktype-core": "23.3.24",
|
|
15
15
|
"collection-utils": "^1.0.1",
|
|
16
|
-
"graphql": "^
|
|
16
|
+
"graphql": "^16.11.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/node": "~22.14.0",
|
|
20
|
-
"@types/graphql": "^0.11.7",
|
|
21
20
|
"typescript": "~5.8.3"
|
|
22
21
|
},
|
|
23
22
|
"files": [
|