@graphql-codegen/client-preset 4.8.0-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4 → 4.8.0-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901

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 CHANGED
@@ -8,6 +8,7 @@ const typedDocumentNodePlugin = tslib_1.__importStar(require("@graphql-codegen/t
8
8
  const typescriptPlugin = tslib_1.__importStar(require("@graphql-codegen/typescript"));
9
9
  const typescriptOperationPlugin = tslib_1.__importStar(require("@graphql-codegen/typescript-operations"));
10
10
  const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
11
+ const graphql_1 = require("graphql");
11
12
  const fragmentMaskingPlugin = tslib_1.__importStar(require("./fragment-masking-plugin.js"));
12
13
  const persisted_documents_js_1 = require("./persisted-documents.js");
13
14
  const process_sources_js_1 = require("./process-sources.js");
@@ -24,9 +25,9 @@ exports.preset = {
24
25
  throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
25
26
  }
26
27
  const isPersistedOperations = !!options.presetConfig?.persistedDocuments;
27
- if (options.config.semanticNonNull?.errorHandlingClient) {
28
+ if (options.config.nullability?.errorHandlingClient) {
28
29
  options.schemaAst = await semanticToStrict(options.schemaAst);
29
- options.schema = options.schemaAst; // FIXME: `schemaAst` _seems_ to be able to used as `schema`, but not sure if it has any side effects?
30
+ options.schema = (0, graphql_1.parse)((0, graphql_1.printSchema)(options.schemaAst));
30
31
  }
31
32
  const reexports = [];
32
33
  // the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
@@ -256,7 +257,7 @@ const semanticToStrict = async (schema) => {
256
257
  return sock.semanticToStrict(schema);
257
258
  }
258
259
  catch {
259
- throw new Error("To use the `customDirective.semanticNonNull` option, you must install the 'graphql-sock' package.");
260
+ throw new Error("To use the `nullability.errorHandlingClient` option, you must install the 'graphql-sock' package.");
260
261
  }
261
262
  };
262
263
  var add_typename_selection_document_transform_js_1 = require("./add-typename-selection-document-transform.js");
package/esm/index.js CHANGED
@@ -4,6 +4,7 @@ import * as typedDocumentNodePlugin from '@graphql-codegen/typed-document-node';
4
4
  import * as typescriptPlugin from '@graphql-codegen/typescript';
5
5
  import * as typescriptOperationPlugin from '@graphql-codegen/typescript-operations';
6
6
  import { ClientSideBaseVisitor, DocumentMode } from '@graphql-codegen/visitor-plugin-common';
7
+ import { parse, printSchema } from 'graphql';
7
8
  import * as fragmentMaskingPlugin from './fragment-masking-plugin.js';
8
9
  import { generateDocumentHash, normalizeAndPrintDocumentNode } from './persisted-documents.js';
9
10
  import { processSources } from './process-sources.js';
@@ -19,9 +20,9 @@ export const preset = {
19
20
  throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
20
21
  }
21
22
  const isPersistedOperations = !!options.presetConfig?.persistedDocuments;
22
- if (options.config.semanticNonNull?.errorHandlingClient) {
23
+ if (options.config.nullability?.errorHandlingClient) {
23
24
  options.schemaAst = await semanticToStrict(options.schemaAst);
24
- options.schema = options.schemaAst; // FIXME: `schemaAst` _seems_ to be able to used as `schema`, but not sure if it has any side effects?
25
+ options.schema = parse(printSchema(options.schemaAst));
25
26
  }
26
27
  const reexports = [];
27
28
  // the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
@@ -251,7 +252,7 @@ const semanticToStrict = async (schema) => {
251
252
  return sock.semanticToStrict(schema);
252
253
  }
253
254
  catch {
254
- throw new Error("To use the `customDirective.semanticNonNull` option, you must install the 'graphql-sock' package.");
255
+ throw new Error("To use the `nullability.errorHandlingClient` option, you must install the 'graphql-sock' package.");
255
256
  }
256
257
  };
257
258
  export { addTypenameSelectionDocumentTransform } from './add-typename-selection-document-transform.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/client-preset",
3
- "version": "4.8.0-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
3
+ "version": "4.8.0-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
4
4
  "description": "GraphQL Code Generator preset for client.",
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
@@ -10,12 +10,12 @@
10
10
  "@babel/helper-plugin-utils": "^7.20.2",
11
11
  "@babel/template": "^7.20.7",
12
12
  "@graphql-codegen/add": "^5.0.3",
13
- "@graphql-codegen/typed-document-node": "5.1.1-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
14
- "@graphql-codegen/typescript": "4.1.6-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
15
- "@graphql-codegen/typescript-operations": "4.6.0-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
16
- "@graphql-codegen/gql-tag-operations": "4.0.17-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
13
+ "@graphql-codegen/typed-document-node": "5.1.1-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
14
+ "@graphql-codegen/typescript": "4.1.6-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
15
+ "@graphql-codegen/typescript-operations": "4.6.0-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
16
+ "@graphql-codegen/gql-tag-operations": "4.0.17-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
17
17
  "@graphql-codegen/plugin-helpers": "^5.1.0",
18
- "@graphql-codegen/visitor-plugin-common": "5.8.0-alpha-20250324100910-f877d4e47f5298bc6a1f0c4650fb3a68df3e25b4",
18
+ "@graphql-codegen/visitor-plugin-common": "5.8.0-alpha-20250326082838-591d10d3f7173174c5ba03cbf8903a4f2fdb7901",
19
19
  "@graphql-typed-document-node/core": "3.2.0",
20
20
  "@graphql-tools/documents": "^1.0.0",
21
21
  "@graphql-tools/utils": "^10.0.0",
@@ -1,5 +1,5 @@
1
1
  import type { Types } from '@graphql-codegen/plugin-helpers';
2
- import type { DocumentNode } from 'graphql';
2
+ import { type DocumentNode } from 'graphql';
3
3
  export { default as babelOptimizerPlugin } from './babel.cjs';
4
4
  export type FragmentMaskingConfig = {
5
5
  /** @description Name of the function that should be used for unmasking a masked fragment property.
@@ -1,5 +1,5 @@
1
1
  import type { Types } from '@graphql-codegen/plugin-helpers';
2
- import type { DocumentNode } from 'graphql';
2
+ import { type DocumentNode } from 'graphql';
3
3
  export { default as babelOptimizerPlugin } from './babel.js';
4
4
  export type FragmentMaskingConfig = {
5
5
  /** @description Name of the function that should be used for unmasking a masked fragment property.