@constructive-io/graphql-codegen 2.27.3 → 2.28.1

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.
@@ -333,7 +333,6 @@ function buildDeleteMutationAST(config) {
333
333
  selectionSet: t.selectionSet({
334
334
  selections: [
335
335
  t.field({ name: 'clientMutationId' }),
336
- t.field({ name: 'deletedId' }),
337
336
  ],
338
337
  }),
339
338
  }),
@@ -415,10 +415,9 @@ function generateDeleteMutationHook(table, options = {}) {
415
415
  ]);
416
416
  const variablesInterface = t.tsInterfaceDeclaration(t.identifier(`${(0, utils_1.ucFirst)(mutationName)}MutationVariables`), null, null, variablesInterfaceBody);
417
417
  statements.push(t.exportNamedDeclaration(variablesInterface));
418
- const deletedPkProp = t.tsPropertySignature(t.identifier(`deleted${(0, utils_1.ucFirst)(pkField.name)}`), t.tsTypeAnnotation(t.tsUnionType([pkTypeAnnotation, t.tsNullKeyword()])));
419
418
  const clientMutationIdProp = t.tsPropertySignature(t.identifier('clientMutationId'), t.tsTypeAnnotation(t.tsUnionType([t.tsStringKeyword(), t.tsNullKeyword()])));
420
419
  const resultInterfaceBody = t.tsInterfaceBody([
421
- t.tsPropertySignature(t.identifier(mutationName), t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp, deletedPkProp]))),
420
+ t.tsPropertySignature(t.identifier(mutationName), t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp]))),
422
421
  ]);
423
422
  const resultInterface = t.tsInterfaceDeclaration(t.identifier(`${(0, utils_1.ucFirst)(mutationName)}MutationResult`), null, null, resultInterfaceBody);
424
423
  statements.push(t.exportNamedDeclaration(resultInterface));
package/cli/index.d.ts CHANGED
@@ -2,7 +2,6 @@
2
2
  /**
3
3
  * CLI entry point for graphql-codegen
4
4
  */
5
- import { CLIOptions, Inquirerer } from 'inquirerer';
6
- import { ParsedArgs } from 'minimist';
5
+ import { CLIOptions, Inquirerer, ParsedArgs } from 'inquirerer';
7
6
  export declare const commands: (argv: Partial<ParsedArgs>, prompter: Inquirerer, _options: CLIOptions) => Promise<Partial<ParsedArgs>>;
8
7
  export declare const options: Partial<CLIOptions>;
package/cli/index.js CHANGED
@@ -38,8 +38,6 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  })();
39
39
  Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.options = exports.commands = void 0;
41
- const find_and_require_package_json_1 = require("find-and-require-package-json");
42
- const utils_1 = require("@inquirerer/utils");
43
41
  const inquirerer_1 = require("inquirerer");
44
42
  const init_1 = require("./commands/init");
45
43
  const generate_1 = require("./commands/generate");
@@ -548,11 +546,11 @@ const createCommandMap = () => {
548
546
  };
549
547
  const commands = async (argv, prompter, _options) => {
550
548
  if (argv.version || argv.v) {
551
- const pkg = (0, find_and_require_package_json_1.findAndRequirePackageJson)(__dirname);
549
+ const pkg = (0, inquirerer_1.getPackageJson)(__dirname);
552
550
  console.log(pkg.version);
553
551
  process.exit(0);
554
552
  }
555
- const { first: command, newArgv } = (0, utils_1.extractFirst)(argv);
553
+ const { first: command, newArgv } = (0, inquirerer_1.extractFirst)(argv);
556
554
  if ((argv.help || argv.h) && !command) {
557
555
  console.log(usageText);
558
556
  process.exit(0);
@@ -582,7 +580,7 @@ const commands = async (argv, prompter, _options) => {
582
580
  const commandFn = commandMap[command];
583
581
  if (!commandFn) {
584
582
  console.log(usageText);
585
- await (0, utils_1.cliExitWithError)(`Unknown command: ${command}`);
583
+ await (0, inquirerer_1.cliExitWithError)(`Unknown command: ${command}`);
586
584
  }
587
585
  await commandFn(newArgv);
588
586
  prompter.close();
@@ -613,7 +611,7 @@ exports.options = {
613
611
  };
614
612
  if (require.main === module) {
615
613
  if (process.argv.includes('--version') || process.argv.includes('-v')) {
616
- const pkg = (0, find_and_require_package_json_1.findAndRequirePackageJson)(__dirname);
614
+ const pkg = (0, inquirerer_1.getPackageJson)(__dirname);
617
615
  console.log(pkg.version);
618
616
  process.exit(0);
619
617
  }
@@ -292,7 +292,6 @@ export function buildDeleteMutationAST(config) {
292
292
  selectionSet: t.selectionSet({
293
293
  selections: [
294
294
  t.field({ name: 'clientMutationId' }),
295
- t.field({ name: 'deletedId' }),
296
295
  ],
297
296
  }),
298
297
  }),
@@ -376,10 +376,9 @@ export function generateDeleteMutationHook(table, options = {}) {
376
376
  ]);
377
377
  const variablesInterface = t.tsInterfaceDeclaration(t.identifier(`${ucFirst(mutationName)}MutationVariables`), null, null, variablesInterfaceBody);
378
378
  statements.push(t.exportNamedDeclaration(variablesInterface));
379
- const deletedPkProp = t.tsPropertySignature(t.identifier(`deleted${ucFirst(pkField.name)}`), t.tsTypeAnnotation(t.tsUnionType([pkTypeAnnotation, t.tsNullKeyword()])));
380
379
  const clientMutationIdProp = t.tsPropertySignature(t.identifier('clientMutationId'), t.tsTypeAnnotation(t.tsUnionType([t.tsStringKeyword(), t.tsNullKeyword()])));
381
380
  const resultInterfaceBody = t.tsInterfaceBody([
382
- t.tsPropertySignature(t.identifier(mutationName), t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp, deletedPkProp]))),
381
+ t.tsPropertySignature(t.identifier(mutationName), t.tsTypeAnnotation(t.tsTypeLiteral([clientMutationIdProp]))),
383
382
  ]);
384
383
  const resultInterface = t.tsInterfaceDeclaration(t.identifier(`${ucFirst(mutationName)}MutationResult`), null, null, resultInterfaceBody);
385
384
  statements.push(t.exportNamedDeclaration(resultInterface));
@@ -2,7 +2,6 @@
2
2
  /**
3
3
  * CLI entry point for graphql-codegen
4
4
  */
5
- import { CLIOptions, Inquirerer } from 'inquirerer';
6
- import { ParsedArgs } from 'minimist';
5
+ import { CLIOptions, Inquirerer, ParsedArgs } from 'inquirerer';
7
6
  export declare const commands: (argv: Partial<ParsedArgs>, prompter: Inquirerer, _options: CLIOptions) => Promise<Partial<ParsedArgs>>;
8
7
  export declare const options: Partial<CLIOptions>;
package/esm/cli/index.js CHANGED
@@ -2,9 +2,7 @@
2
2
  /**
3
3
  * CLI entry point for graphql-codegen
4
4
  */
5
- import { findAndRequirePackageJson } from 'find-and-require-package-json';
6
- import { cliExitWithError, extractFirst } from '@inquirerer/utils';
7
- import { CLI } from 'inquirerer';
5
+ import { CLI, cliExitWithError, extractFirst, getPackageJson } from 'inquirerer';
8
6
  import { initCommand, findConfigFile, loadConfigFile } from './commands/init';
9
7
  import { generateCommand } from './commands/generate';
10
8
  import { generateOrmCommand } from './commands/generate-orm';
@@ -512,7 +510,7 @@ const createCommandMap = () => {
512
510
  };
513
511
  export const commands = async (argv, prompter, _options) => {
514
512
  if (argv.version || argv.v) {
515
- const pkg = findAndRequirePackageJson(__dirname);
513
+ const pkg = getPackageJson(__dirname);
516
514
  console.log(pkg.version);
517
515
  process.exit(0);
518
516
  }
@@ -576,7 +574,7 @@ export const options = {
576
574
  };
577
575
  if (require.main === module) {
578
576
  if (process.argv.includes('--version') || process.argv.includes('-v')) {
579
- const pkg = findAndRequirePackageJson(__dirname);
577
+ const pkg = getPackageJson(__dirname);
580
578
  console.log(pkg.version);
581
579
  process.exit(0);
582
580
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-codegen",
3
- "version": "2.27.3",
3
+ "version": "2.28.1",
4
4
  "description": "CLI-based GraphQL SDK generator for PostGraphile endpoints with React Query hooks",
5
5
  "keywords": [
6
6
  "graphql",
@@ -54,15 +54,14 @@
54
54
  "dependencies": {
55
55
  "@babel/generator": "^7.28.6",
56
56
  "@babel/types": "^7.28.6",
57
- "@inquirerer/utils": "^3.1.3",
57
+ "@inquirerer/utils": "^3.2.0",
58
58
  "ajv": "^8.17.1",
59
- "find-and-require-package-json": "^0.8.6",
59
+ "find-and-require-package-json": "^0.9.0",
60
60
  "gql-ast": "^2.6.0",
61
61
  "graphql": "15.10.1",
62
- "inflekt": "^0.2.0",
63
- "inquirerer": "^4.3.1",
62
+ "inflekt": "^0.3.0",
63
+ "inquirerer": "^4.4.0",
64
64
  "jiti": "^2.6.1",
65
- "minimist": "^1.2.8",
66
65
  "oxfmt": "^0.13.0"
67
66
  },
68
67
  "peerDependencies": {
@@ -78,17 +77,16 @@
78
77
  }
79
78
  },
80
79
  "devDependencies": {
81
- "@tanstack/react-query": "^5.90.16",
80
+ "@tanstack/react-query": "^5.90.19",
82
81
  "@types/babel__generator": "^7.27.0",
83
- "@types/jest": "^29.5.14",
84
- "@types/minimist": "^1.2.5",
82
+ "@types/jest": "^30.0.0",
85
83
  "@types/node": "^20.19.27",
86
- "@types/react": "^19.2.7",
87
- "jest": "^29.7.0",
84
+ "@types/react": "^19.2.8",
85
+ "jest": "^30.2.0",
88
86
  "react": "^19.2.3",
89
87
  "ts-jest": "^29.2.5",
90
88
  "tsx": "^4.21.0",
91
89
  "typescript": "^5.9.3"
92
90
  },
93
- "gitHead": "5ec5f1eb56490ffcf38fbc9949abc6905832083c"
91
+ "gitHead": "b10f4573bc0daa50502a1a5ea8ba610e00c3996b"
94
92
  }