@graphql-codegen/typescript 3.0.3-alpha-20230330112047-da0c5ec12 → 3.0.3-alpha-20230330142525-09b25a034
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/cjs/index.js +7 -5
- package/esm/index.js +7 -5
- package/package.json +3 -3
package/cjs/index.js
CHANGED
|
@@ -47,11 +47,13 @@ function includeIntrospectionTypesDefinitions(schema, documents, config) {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
for (const doc of documents) {
|
|
51
|
+
(0, graphql_1.visit)(doc.document, documentsVisitor);
|
|
52
|
+
}
|
|
51
53
|
const typesToInclude = [];
|
|
52
|
-
|
|
54
|
+
for (const type of usedTypes) {
|
|
53
55
|
collectTypes(type);
|
|
54
|
-
}
|
|
56
|
+
}
|
|
55
57
|
const visitor = new introspection_visitor_js_1.TsIntrospectionVisitor(schema, config, typesToInclude);
|
|
56
58
|
const result = (0, plugin_helpers_1.oldVisit)((0, graphql_1.parse)((0, graphql_1.printIntrospectionSchema)(schema)), { leave: visitor });
|
|
57
59
|
// recursively go through each `usedTypes` and their children and collect all used types
|
|
@@ -63,11 +65,11 @@ function includeIntrospectionTypesDefinitions(schema, documents, config) {
|
|
|
63
65
|
typesToInclude.push(type);
|
|
64
66
|
if ((0, graphql_1.isObjectType)(type)) {
|
|
65
67
|
const fields = type.getFields();
|
|
66
|
-
Object.keys(fields)
|
|
68
|
+
for (const key of Object.keys(fields)) {
|
|
67
69
|
const field = fields[key];
|
|
68
70
|
const type = (0, graphql_1.getNamedType)(field.type);
|
|
69
71
|
collectTypes(type);
|
|
70
|
-
}
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
75
|
return result.definitions;
|
package/esm/index.js
CHANGED
|
@@ -42,11 +42,13 @@ export function includeIntrospectionTypesDefinitions(schema, documents, config)
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
});
|
|
45
|
-
|
|
45
|
+
for (const doc of documents) {
|
|
46
|
+
visit(doc.document, documentsVisitor);
|
|
47
|
+
}
|
|
46
48
|
const typesToInclude = [];
|
|
47
|
-
|
|
49
|
+
for (const type of usedTypes) {
|
|
48
50
|
collectTypes(type);
|
|
49
|
-
}
|
|
51
|
+
}
|
|
50
52
|
const visitor = new TsIntrospectionVisitor(schema, config, typesToInclude);
|
|
51
53
|
const result = oldVisit(parse(printIntrospectionSchema(schema)), { leave: visitor });
|
|
52
54
|
// recursively go through each `usedTypes` and their children and collect all used types
|
|
@@ -58,11 +60,11 @@ export function includeIntrospectionTypesDefinitions(schema, documents, config)
|
|
|
58
60
|
typesToInclude.push(type);
|
|
59
61
|
if (isObjectType(type)) {
|
|
60
62
|
const fields = type.getFields();
|
|
61
|
-
Object.keys(fields)
|
|
63
|
+
for (const key of Object.keys(fields)) {
|
|
62
64
|
const field = fields[key];
|
|
63
65
|
const type = getNamedType(field.type);
|
|
64
66
|
collectTypes(type);
|
|
65
|
-
}
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
return result.definitions;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript",
|
|
3
|
-
"version": "3.0.3-alpha-
|
|
3
|
+
"version": "3.0.3-alpha-20230330142525-09b25a034",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript types",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "4.2.0-alpha-
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "4.2.0-alpha-20230330142525-09b25a034",
|
|
10
10
|
"@graphql-codegen/schema-ast": "^3.0.1",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "3.1.0-alpha-20230330142525-09b25a034",
|
|
12
12
|
"auto-bind": "~4.0.0",
|
|
13
13
|
"tslib": "~2.5.0"
|
|
14
14
|
},
|