graphql-data-generator 0.1.4 → 0.1.5

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/cli.js CHANGED
@@ -14,8 +14,8 @@ const args = parseArgs({
14
14
  operations: { type: "string", multiple: true },
15
15
  scalar: { type: "string", multiple: true },
16
16
  outfile: { type: "string" },
17
- useEnums: { type: "boolean", default: false },
18
- includeTypenames: { type: "boolean", default: true },
17
+ enums: { type: "boolean" },
18
+ notypenames: { type: "boolean" },
19
19
  },
20
20
  }).values;
21
21
  const findFirst = async (path) => {
@@ -61,8 +61,8 @@ if (args.scalar) {
61
61
  }
62
62
  try {
63
63
  const file = await formatCode(codegen(schema, operations, {
64
- useEnums: args.useEnums,
65
- includeTypenames: args.includeTypenames,
64
+ useEnums: args.enums ?? false,
65
+ includeTypenames: !args.notypenames,
66
66
  scalars,
67
67
  }));
68
68
  if (args.outfile)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-data-generator",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/vocesgraphql-data-generator/.git"
@@ -25,11 +25,13 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "fast-glob": "*",
28
- "graphql": "*",
29
28
  "@deno/shim-deno": "~0.18.0"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@types/node": "^20.9.0"
33
32
  },
34
- "_generatedBy": "dnt@dev"
33
+ "_generatedBy": "dnt@dev",
34
+ "peerDependencies": {
35
+ "graphql": "*"
36
+ }
35
37
  }
@@ -40,7 +40,7 @@ type MapOperationsToBuilders<T, Transforms, Extra> = {
40
40
  data: infer U;
41
41
  } ? U extends Record<string, unknown> ? U : Record<string, unknown> : Record<string, unknown>, T[K] extends {
42
42
  variables: infer U;
43
- } ? U : unknown, K extends keyof Transforms ? Transforms[K] : ContravariantEmpty, Extra>;
43
+ } ? U : never, K extends keyof Transforms ? Transforms[K] : ContravariantEmpty, Extra>;
44
44
  };
45
45
  type ResolveOperationConflicts<T, Name extends string, A, B, C, D> = Omit<T, keyof A | keyof B | keyof C | keyof D> & PrefixKeys<Pick<T, keyof T & (keyof A | keyof B | keyof C | keyof D)>, Name>;
46
46
  type ResolveConflicts<Queries, Mutations, Subscriptions, Types, Inputs> = ResolveOperationConflicts<Queries, "queries", Mutations, Subscriptions, Types, Inputs> & ResolveOperationConflicts<Mutations, "mutations", Queries, Subscriptions, Types, Inputs> & ResolveOperationConflicts<Subscriptions, "subscriptions", Queries, Mutations, Types, Inputs>;