graphql-data-generator 0.1.1 → 0.1.3

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/esm/codegen.js CHANGED
@@ -395,7 +395,7 @@ export const codegen = (schema, files, { useEnums = true, scalars = {}, includeT
395
395
  if (type.kind !== "Name") {
396
396
  throw new Error(`Could not find type for variable '${v.variable.name.value}'`);
397
397
  }
398
- if (handledInputs.has(type.value) || scalars[type.value])
398
+ if (handledInputs.has(type.value) || !inputs[type.value])
399
399
  return;
400
400
  const stack = [type.value];
401
401
  while (stack.length) {
@@ -413,7 +413,7 @@ export const codegen = (schema, files, { useEnums = true, scalars = {}, includeT
413
413
  type = type.type;
414
414
  }
415
415
  return type.name.value;
416
- }).filter((t) => !scalars[t]) ?? [];
416
+ }).filter((t) => inputs[t]) ?? [];
417
417
  if (subFieldTypes.some((t) => !handledInputs.has(t))) {
418
418
  stack.push(current);
419
419
  stack.push(...subFieldTypes);
@@ -469,7 +469,7 @@ ${usedTypes.map(([name]) => ` ${name}: ${name};`).join("\n")}
469
469
  }
470
470
  if (useEnums) {
471
471
  return `enum ${r.name.value} {
472
- ${r.values?.map((r) => r.name.value).join(",\n ")}
472
+ ${r.values?.map((r) => r.name.value).join(",\n ")},
473
473
  }`;
474
474
  }
475
475
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-data-generator",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vocesgraphql-data-generator/.git"
@@ -10,9 +10,13 @@
10
10
  "url": "https://github.com/voces/graphql-data-generator/issues"
11
11
  },
12
12
  "module": "./esm/index.js",
13
+ "types": "./types/index.d.ts",
13
14
  "exports": {
14
- "./src/index.js": {
15
- "import": "./esm/index.js"
15
+ ".": {
16
+ "import": {
17
+ "types": "./types/index.d.ts",
18
+ "default": "./esm/index.js"
19
+ }
16
20
  }
17
21
  },
18
22
  "bin": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes