@graphql-codegen/client-preset 2.1.1-alpha-20230217094649-681f221a9 → 2.1.1-alpha-20230223110153-09ba767e6
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 +5 -0
- package/esm/index.js +5 -0
- package/package.json +8 -8
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
- package/typings/process-sources.d.cts +1 -1
- package/typings/process-sources.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -142,6 +142,7 @@ exports.preset = {
|
|
|
142
142
|
unmaskFunctionName: fragmentMaskingConfig.unmaskFunctionName,
|
|
143
143
|
},
|
|
144
144
|
documents: [],
|
|
145
|
+
documentTransforms: options.documentTransforms,
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
148
|
let indexFileGenerateConfig = null;
|
|
@@ -165,6 +166,7 @@ exports.preset = {
|
|
|
165
166
|
schema: options.schema,
|
|
166
167
|
config: {},
|
|
167
168
|
documents: [],
|
|
169
|
+
documentTransforms: options.documentTransforms,
|
|
168
170
|
};
|
|
169
171
|
}
|
|
170
172
|
return [
|
|
@@ -178,6 +180,7 @@ exports.preset = {
|
|
|
178
180
|
...forwardedConfig,
|
|
179
181
|
},
|
|
180
182
|
documents: sources,
|
|
183
|
+
documentTransforms: options.documentTransforms,
|
|
181
184
|
},
|
|
182
185
|
{
|
|
183
186
|
filename: `${options.baseOutputDir}gql${gqlArtifactFileExtension}`,
|
|
@@ -189,6 +192,7 @@ exports.preset = {
|
|
|
189
192
|
gqlTagName: options.presetConfig.gqlTagName || 'graphql',
|
|
190
193
|
},
|
|
191
194
|
documents: sources,
|
|
195
|
+
documentTransforms: options.documentTransforms,
|
|
192
196
|
},
|
|
193
197
|
...(isPersistedOperations
|
|
194
198
|
? [
|
|
@@ -212,6 +216,7 @@ exports.preset = {
|
|
|
212
216
|
schema: options.schema,
|
|
213
217
|
config: {},
|
|
214
218
|
documents: sources,
|
|
219
|
+
documentTransforms: options.documentTransforms,
|
|
215
220
|
},
|
|
216
221
|
]
|
|
217
222
|
: []),
|
package/esm/index.js
CHANGED
|
@@ -137,6 +137,7 @@ export const preset = {
|
|
|
137
137
|
unmaskFunctionName: fragmentMaskingConfig.unmaskFunctionName,
|
|
138
138
|
},
|
|
139
139
|
documents: [],
|
|
140
|
+
documentTransforms: options.documentTransforms,
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
143
|
let indexFileGenerateConfig = null;
|
|
@@ -160,6 +161,7 @@ export const preset = {
|
|
|
160
161
|
schema: options.schema,
|
|
161
162
|
config: {},
|
|
162
163
|
documents: [],
|
|
164
|
+
documentTransforms: options.documentTransforms,
|
|
163
165
|
};
|
|
164
166
|
}
|
|
165
167
|
return [
|
|
@@ -173,6 +175,7 @@ export const preset = {
|
|
|
173
175
|
...forwardedConfig,
|
|
174
176
|
},
|
|
175
177
|
documents: sources,
|
|
178
|
+
documentTransforms: options.documentTransforms,
|
|
176
179
|
},
|
|
177
180
|
{
|
|
178
181
|
filename: `${options.baseOutputDir}gql${gqlArtifactFileExtension}`,
|
|
@@ -184,6 +187,7 @@ export const preset = {
|
|
|
184
187
|
gqlTagName: options.presetConfig.gqlTagName || 'graphql',
|
|
185
188
|
},
|
|
186
189
|
documents: sources,
|
|
190
|
+
documentTransforms: options.documentTransforms,
|
|
187
191
|
},
|
|
188
192
|
...(isPersistedOperations
|
|
189
193
|
? [
|
|
@@ -207,6 +211,7 @@ export const preset = {
|
|
|
207
211
|
schema: options.schema,
|
|
208
212
|
config: {},
|
|
209
213
|
documents: sources,
|
|
214
|
+
documentTransforms: options.documentTransforms,
|
|
210
215
|
},
|
|
211
216
|
]
|
|
212
217
|
: []),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/client-preset",
|
|
3
|
-
"version": "2.1.1-alpha-
|
|
3
|
+
"version": "2.1.1-alpha-20230223110153-09ba767e6",
|
|
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"
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@babel/helper-plugin-utils": "^7.20.2",
|
|
10
10
|
"@babel/template": "^7.20.7",
|
|
11
|
-
"@graphql-codegen/add": "4.0.
|
|
12
|
-
"@graphql-codegen/typed-document-node": "3.0.
|
|
13
|
-
"@graphql-codegen/typescript": "3.0.
|
|
14
|
-
"@graphql-codegen/typescript-operations": "3.0.
|
|
15
|
-
"@graphql-codegen/gql-tag-operations": "2.0.
|
|
11
|
+
"@graphql-codegen/add": "^4.0.1",
|
|
12
|
+
"@graphql-codegen/typed-document-node": "^3.0.1",
|
|
13
|
+
"@graphql-codegen/typescript": "^3.0.1",
|
|
14
|
+
"@graphql-codegen/typescript-operations": "^3.0.1",
|
|
15
|
+
"@graphql-codegen/gql-tag-operations": "2.0.1",
|
|
16
16
|
"@graphql-codegen/plugin-helpers": "^4.1.0",
|
|
17
|
-
"@graphql-codegen/visitor-plugin-common": "3.0.
|
|
18
|
-
"@graphql-typed-document-node/core": "3.1.
|
|
17
|
+
"@graphql-codegen/visitor-plugin-common": "^3.0.1",
|
|
18
|
+
"@graphql-typed-document-node/core": "3.1.2",
|
|
19
19
|
"@graphql-tools/documents": "^0.1.0",
|
|
20
20
|
"@graphql-tools/utils": "^9.0.0",
|
|
21
21
|
"tslib": "~2.5.0"
|
package/typings/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { DocumentNode } from 'graphql';
|
|
3
3
|
export { default as babelOptimizerPlugin } from './babel.cjs';
|
|
4
|
-
export
|
|
4
|
+
export type FragmentMaskingConfig = {
|
|
5
5
|
/** @description Name of the function that should be used for unmasking a masked fragment property.
|
|
6
6
|
* @default `'useFragment'`
|
|
7
7
|
*/
|
|
8
8
|
unmaskFunctionName?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type ClientPresetConfig = {
|
|
11
11
|
/**
|
|
12
12
|
* @description Fragment masking hides data from components and only allows accessing the data by using a unmasking function.
|
|
13
13
|
* @exampleMarkdown
|
package/typings/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { DocumentNode } from 'graphql';
|
|
3
3
|
export { default as babelOptimizerPlugin } from './babel.js';
|
|
4
|
-
export
|
|
4
|
+
export type FragmentMaskingConfig = {
|
|
5
5
|
/** @description Name of the function that should be used for unmasking a masked fragment property.
|
|
6
6
|
* @default `'useFragment'`
|
|
7
7
|
*/
|
|
8
8
|
unmaskFunctionName?: string;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type ClientPresetConfig = {
|
|
11
11
|
/**
|
|
12
12
|
* @description Fragment masking hides data from components and only allows accessing the data by using a unmasking function.
|
|
13
13
|
* @exampleMarkdown
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceWithOperations } from '@graphql-codegen/gql-tag-operations';
|
|
2
2
|
import { Source } from '@graphql-tools/utils';
|
|
3
3
|
import { FragmentDefinitionNode, OperationDefinitionNode } from 'graphql';
|
|
4
|
-
export
|
|
4
|
+
export type BuildNameFunction = (type: OperationDefinitionNode | FragmentDefinitionNode) => string;
|
|
5
5
|
export declare function processSources(sources: Array<Source>, buildName: BuildNameFunction): SourceWithOperations[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceWithOperations } from '@graphql-codegen/gql-tag-operations';
|
|
2
2
|
import { Source } from '@graphql-tools/utils';
|
|
3
3
|
import { FragmentDefinitionNode, OperationDefinitionNode } from 'graphql';
|
|
4
|
-
export
|
|
4
|
+
export type BuildNameFunction = (type: OperationDefinitionNode | FragmentDefinitionNode) => string;
|
|
5
5
|
export declare function processSources(sources: Array<Source>, buildName: BuildNameFunction): SourceWithOperations[];
|