@graphql-codegen/typescript-enum-array 2.1.2-alpha-4a7e799f2.0 → 2.1.2-alpha-78670e76d.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/index.js +3 -4
- package/index.mjs +3 -4
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -28,13 +28,12 @@ function buildImportStatement(enums, importFrom) {
|
|
|
28
28
|
const names = Object.values(enums).map(e => e.name);
|
|
29
29
|
return [`import { ${names.join(', ')} } from "${importFrom}";`];
|
|
30
30
|
}
|
|
31
|
-
const plugin =
|
|
32
|
-
const importFrom = config.importFrom;
|
|
31
|
+
const plugin = (schema, _documents, config) => {
|
|
33
32
|
const enums = getEnumTypeMap(schema);
|
|
34
33
|
const content = enums.map(buildArrayDefinition).join('\n');
|
|
35
34
|
const result = { content };
|
|
36
|
-
if (importFrom) {
|
|
37
|
-
result['prepend'] = buildImportStatement(enums, importFrom);
|
|
35
|
+
if (config.importFrom) {
|
|
36
|
+
result['prepend'] = buildImportStatement(enums, config.importFrom);
|
|
38
37
|
}
|
|
39
38
|
return result;
|
|
40
39
|
};
|
package/index.mjs
CHANGED
|
@@ -24,13 +24,12 @@ function buildImportStatement(enums, importFrom) {
|
|
|
24
24
|
const names = Object.values(enums).map(e => e.name);
|
|
25
25
|
return [`import { ${names.join(', ')} } from "${importFrom}";`];
|
|
26
26
|
}
|
|
27
|
-
const plugin =
|
|
28
|
-
const importFrom = config.importFrom;
|
|
27
|
+
const plugin = (schema, _documents, config) => {
|
|
29
28
|
const enums = getEnumTypeMap(schema);
|
|
30
29
|
const content = enums.map(buildArrayDefinition).join('\n');
|
|
31
30
|
const result = { content };
|
|
32
|
-
if (importFrom) {
|
|
33
|
-
result['prepend'] = buildImportStatement(enums, importFrom);
|
|
31
|
+
if (config.importFrom) {
|
|
32
|
+
result['prepend'] = buildImportStatement(enums, config.importFrom);
|
|
34
33
|
}
|
|
35
34
|
return result;
|
|
36
35
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-enum-array",
|
|
3
|
-
"version": "2.1.2-alpha-
|
|
3
|
+
"version": "2.1.2-alpha-78670e76d.0",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for adding const array",
|
|
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": "2.
|
|
10
|
-
"tslib": "~2.
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^2.3.2",
|
|
10
|
+
"tslib": "~2.4.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|