@graphql-codegen/client-preset 4.7.1-alpha-20250324095934-a83c6c81df422f6008e4952d91a12a5294a915ba → 4.7.1-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d
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 +1 -14
- package/esm/index.js +1 -14
- package/package.json +7 -8
- package/typings/index.d.cts +1 -1
- package/typings/index.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "babelOptimizerPlugin", { enumerable: true, get:
|
|
|
16
16
|
const isOutputFolderLike = (baseOutputDir) => baseOutputDir.endsWith('/');
|
|
17
17
|
exports.preset = {
|
|
18
18
|
prepareDocuments: (outputFilePath, outputSpecificDocuments) => [...outputSpecificDocuments, `!${outputFilePath}`],
|
|
19
|
-
buildGeneratesSection:
|
|
19
|
+
buildGeneratesSection: options => {
|
|
20
20
|
if (!isOutputFolderLike(options.baseOutputDir)) {
|
|
21
21
|
throw new Error('[client-preset] target output should be a directory, ex: "src/gql/". Make sure you add "/" at the end of the directory path');
|
|
22
22
|
}
|
|
@@ -24,10 +24,6 @@ exports.preset = {
|
|
|
24
24
|
throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
|
|
25
25
|
}
|
|
26
26
|
const isPersistedOperations = !!options.presetConfig?.persistedDocuments;
|
|
27
|
-
if (options.config.semanticNonNull?.errorHandlingClient) {
|
|
28
|
-
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
|
-
}
|
|
31
27
|
const reexports = [];
|
|
32
28
|
// the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
|
|
33
29
|
const forwardedConfig = {
|
|
@@ -250,14 +246,5 @@ function createDeferred() {
|
|
|
250
246
|
});
|
|
251
247
|
return d;
|
|
252
248
|
}
|
|
253
|
-
const semanticToStrict = async (schema) => {
|
|
254
|
-
try {
|
|
255
|
-
const sock = await Promise.resolve().then(() => tslib_1.__importStar(require('graphql-sock')));
|
|
256
|
-
return sock.semanticToStrict(schema);
|
|
257
|
-
}
|
|
258
|
-
catch {
|
|
259
|
-
throw new Error("To use the `customDirective.semanticNonNull` option, you must install the 'graphql-sock' package.");
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
249
|
var add_typename_selection_document_transform_js_1 = require("./add-typename-selection-document-transform.js");
|
|
263
250
|
Object.defineProperty(exports, "addTypenameSelectionDocumentTransform", { enumerable: true, get: function () { return add_typename_selection_document_transform_js_1.addTypenameSelectionDocumentTransform; } });
|
package/esm/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { default as babelOptimizerPlugin } from './babel.js';
|
|
|
11
11
|
const isOutputFolderLike = (baseOutputDir) => baseOutputDir.endsWith('/');
|
|
12
12
|
export const preset = {
|
|
13
13
|
prepareDocuments: (outputFilePath, outputSpecificDocuments) => [...outputSpecificDocuments, `!${outputFilePath}`],
|
|
14
|
-
buildGeneratesSection:
|
|
14
|
+
buildGeneratesSection: options => {
|
|
15
15
|
if (!isOutputFolderLike(options.baseOutputDir)) {
|
|
16
16
|
throw new Error('[client-preset] target output should be a directory, ex: "src/gql/". Make sure you add "/" at the end of the directory path');
|
|
17
17
|
}
|
|
@@ -19,10 +19,6 @@ export const preset = {
|
|
|
19
19
|
throw new Error('[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types');
|
|
20
20
|
}
|
|
21
21
|
const isPersistedOperations = !!options.presetConfig?.persistedDocuments;
|
|
22
|
-
if (options.config.semanticNonNull?.errorHandlingClient) {
|
|
23
|
-
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
|
-
}
|
|
26
22
|
const reexports = [];
|
|
27
23
|
// the `client` preset is restricting the config options inherited from `typescript`, `typescript-operations` and others.
|
|
28
24
|
const forwardedConfig = {
|
|
@@ -245,13 +241,4 @@ function createDeferred() {
|
|
|
245
241
|
});
|
|
246
242
|
return d;
|
|
247
243
|
}
|
|
248
|
-
const semanticToStrict = async (schema) => {
|
|
249
|
-
try {
|
|
250
|
-
const sock = await import('graphql-sock');
|
|
251
|
-
return sock.semanticToStrict(schema);
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
throw new Error("To use the `customDirective.semanticNonNull` option, you must install the 'graphql-sock' package.");
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
244
|
export { addTypenameSelectionDocumentTransform } from './add-typename-selection-document-transform.js';
|
package/package.json
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/client-preset",
|
|
3
|
-
"version": "4.7.1-alpha-
|
|
3
|
+
"version": "4.7.1-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
4
4
|
"description": "GraphQL Code Generator preset for client.",
|
|
5
5
|
"peerDependencies": {
|
|
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"
|
|
7
|
-
"graphql-sock": "^1.0.0"
|
|
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"
|
|
8
7
|
},
|
|
9
8
|
"dependencies": {
|
|
10
9
|
"@babel/helper-plugin-utils": "^7.20.2",
|
|
11
10
|
"@babel/template": "^7.20.7",
|
|
12
11
|
"@graphql-codegen/add": "^5.0.3",
|
|
13
|
-
"@graphql-codegen/typed-document-node": "5.1.1-alpha-
|
|
14
|
-
"@graphql-codegen/typescript": "4.1.6-alpha-
|
|
15
|
-
"@graphql-codegen/typescript-operations": "4.
|
|
16
|
-
"@graphql-codegen/gql-tag-operations": "4.0.17-alpha-
|
|
12
|
+
"@graphql-codegen/typed-document-node": "5.1.1-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
13
|
+
"@graphql-codegen/typescript": "4.1.6-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
14
|
+
"@graphql-codegen/typescript-operations": "4.5.2-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
15
|
+
"@graphql-codegen/gql-tag-operations": "4.0.17-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
17
16
|
"@graphql-codegen/plugin-helpers": "^5.1.0",
|
|
18
|
-
"@graphql-codegen/visitor-plugin-common": "5.8.0-alpha-
|
|
17
|
+
"@graphql-codegen/visitor-plugin-common": "5.8.0-alpha-20250324235332-a2c88e0ffbc7aec7ecfb799202caf8ee040fe47d",
|
|
19
18
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
20
19
|
"@graphql-tools/documents": "^1.0.0",
|
|
21
20
|
"@graphql-tools/utils": "^10.0.0",
|
package/typings/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
|
-
import
|
|
2
|
+
import { 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.
|
package/typings/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
|
-
import
|
|
2
|
+
import { 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.
|