@graphql-codegen/visitor-plugin-common 4.0.0-alpha-20230516105319-614b2d240 → 4.0.0-alpha-20230516213054-2665abf09
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/utils.js +8 -16
- package/esm/utils.js +8 -16
- package/package.json +2 -2
package/cjs/utils.js
CHANGED
|
@@ -240,24 +240,16 @@ function buildScalars(schema, scalarsMapping, defaultScalarsMapping = scalars_js
|
|
|
240
240
|
output: outputMapper,
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
|
-
else if (scalarsMapping && typeof scalarsMapping[name] === 'string') {
|
|
244
|
-
const normalizedScalar = normalizeScalarType(scalarsMapping[name]);
|
|
245
|
-
const inputMapper = (0, mappers_js_1.parseMapper)(normalizedScalar.input, name);
|
|
246
|
-
if (inputMapper.isExternal) {
|
|
247
|
-
inputMapper.type += "['input']";
|
|
248
|
-
}
|
|
249
|
-
const outputMapper = (0, mappers_js_1.parseMapper)(normalizedScalar.output, name);
|
|
250
|
-
if (outputMapper.isExternal) {
|
|
251
|
-
outputMapper.type += "['output']";
|
|
252
|
-
}
|
|
253
|
-
result[name] = {
|
|
254
|
-
input: inputMapper,
|
|
255
|
-
output: outputMapper,
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
243
|
else if (scalarsMapping === null || scalarsMapping === void 0 ? void 0 : scalarsMapping[name]) {
|
|
259
244
|
const mappedScalar = scalarsMapping[name];
|
|
260
|
-
if (typeof mappedScalar === '
|
|
245
|
+
if (typeof mappedScalar === 'string') {
|
|
246
|
+
const normalizedScalar = normalizeScalarType(scalarsMapping[name]);
|
|
247
|
+
result[name] = {
|
|
248
|
+
input: (0, mappers_js_1.parseMapper)(normalizedScalar.input, name),
|
|
249
|
+
output: (0, mappers_js_1.parseMapper)(normalizedScalar.output, name),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
else if (typeof mappedScalar === 'object' && mappedScalar.input && mappedScalar.output) {
|
|
261
253
|
result[name] = {
|
|
262
254
|
input: (0, mappers_js_1.parseMapper)(mappedScalar.input, name),
|
|
263
255
|
output: (0, mappers_js_1.parseMapper)(mappedScalar.output, name),
|
package/esm/utils.js
CHANGED
|
@@ -225,24 +225,16 @@ export function buildScalars(schema, scalarsMapping, defaultScalarsMapping = DEF
|
|
|
225
225
|
output: outputMapper,
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
else if (scalarsMapping && typeof scalarsMapping[name] === 'string') {
|
|
229
|
-
const normalizedScalar = normalizeScalarType(scalarsMapping[name]);
|
|
230
|
-
const inputMapper = parseMapper(normalizedScalar.input, name);
|
|
231
|
-
if (inputMapper.isExternal) {
|
|
232
|
-
inputMapper.type += "['input']";
|
|
233
|
-
}
|
|
234
|
-
const outputMapper = parseMapper(normalizedScalar.output, name);
|
|
235
|
-
if (outputMapper.isExternal) {
|
|
236
|
-
outputMapper.type += "['output']";
|
|
237
|
-
}
|
|
238
|
-
result[name] = {
|
|
239
|
-
input: inputMapper,
|
|
240
|
-
output: outputMapper,
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
228
|
else if (scalarsMapping === null || scalarsMapping === void 0 ? void 0 : scalarsMapping[name]) {
|
|
244
229
|
const mappedScalar = scalarsMapping[name];
|
|
245
|
-
if (typeof mappedScalar === '
|
|
230
|
+
if (typeof mappedScalar === 'string') {
|
|
231
|
+
const normalizedScalar = normalizeScalarType(scalarsMapping[name]);
|
|
232
|
+
result[name] = {
|
|
233
|
+
input: parseMapper(normalizedScalar.input, name),
|
|
234
|
+
output: parseMapper(normalizedScalar.output, name),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
else if (typeof mappedScalar === 'object' && mappedScalar.input && mappedScalar.output) {
|
|
246
238
|
result[name] = {
|
|
247
239
|
input: parseMapper(mappedScalar.input, name),
|
|
248
240
|
output: parseMapper(mappedScalar.output, name),
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/visitor-plugin-common",
|
|
3
|
-
"version": "4.0.0-alpha-
|
|
3
|
+
"version": "4.0.0-alpha-20230516213054-2665abf09",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"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"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@graphql-tools/optimize": "^1.3.0",
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "4.2.1-alpha-
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "4.2.1-alpha-20230516213054-2665abf09",
|
|
10
10
|
"@graphql-tools/relay-operation-optimizer": "^6.5.0",
|
|
11
11
|
"@graphql-tools/utils": "^9.0.0",
|
|
12
12
|
"auto-bind": "~4.0.0",
|