@graphql-tools/utils 10.10.0-alpha-20250926211300-003148d02ebf650219d034d55ebcb664b8d91c29 → 11.0.0-alpha-20250924153515-3751f8516e3574cdd5775626a4f44e799a9c60bc
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.
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildOperationNodeForField = buildOperationNodeForField;
|
|
4
4
|
const graphql_1 = require("graphql");
|
|
5
|
-
const astFromValueUntyped_js_1 = require("./astFromValueUntyped.js");
|
|
6
5
|
const rootTypes_js_1 = require("./rootTypes.js");
|
|
7
6
|
let operationVariables = [];
|
|
8
7
|
let fieldTypeMap = new Map();
|
|
@@ -242,25 +241,6 @@ function resolveVariable(arg, name) {
|
|
|
242
241
|
},
|
|
243
242
|
};
|
|
244
243
|
}
|
|
245
|
-
let defaultValue;
|
|
246
|
-
try {
|
|
247
|
-
const returnVal = (0, graphql_1.astFromValue)(arg.defaultValue, arg.type);
|
|
248
|
-
if (returnVal == null) {
|
|
249
|
-
defaultValue = undefined;
|
|
250
|
-
}
|
|
251
|
-
else {
|
|
252
|
-
defaultValue = returnVal;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
catch (e) {
|
|
256
|
-
const returnVal = (0, astFromValueUntyped_js_1.astFromValueUntyped)(arg.defaultValue);
|
|
257
|
-
if (returnVal == null) {
|
|
258
|
-
defaultValue = undefined;
|
|
259
|
-
}
|
|
260
|
-
else {
|
|
261
|
-
defaultValue = returnVal;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
244
|
return {
|
|
265
245
|
kind: graphql_1.Kind.VARIABLE_DEFINITION,
|
|
266
246
|
variable: {
|
|
@@ -271,7 +251,6 @@ function resolveVariable(arg, name) {
|
|
|
271
251
|
},
|
|
272
252
|
},
|
|
273
253
|
type: resolveVariableType(arg.type),
|
|
274
|
-
defaultValue,
|
|
275
254
|
};
|
|
276
255
|
}
|
|
277
256
|
function getArgumentName(name, path) {
|
package/cjs/mapSchema.js
CHANGED
|
@@ -21,11 +21,10 @@ function mapSchema(schema, schemaMapper = {}) {
|
|
|
21
21
|
directives,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
const builtinTypes = ['String', 'ID', 'Int', 'Float', 'Boolean'];
|
|
25
24
|
function mapTypes(originalTypeMap, schema, schemaMapper, testFn = () => true) {
|
|
26
25
|
const newTypeMap = {};
|
|
27
26
|
for (const typeName in originalTypeMap) {
|
|
28
|
-
if (!typeName.startsWith('__')
|
|
27
|
+
if (!typeName.startsWith('__')) {
|
|
29
28
|
const originalType = originalTypeMap[typeName];
|
|
30
29
|
if (originalType == null || !testFn(originalType)) {
|
|
31
30
|
newTypeMap[typeName] = originalType;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { astFromValueUntyped } from './astFromValueUntyped.js';
|
|
1
|
+
import { getNamedType, isEnumType, isInterfaceType, isListType, isNonNullType, isObjectType, isScalarType, isUnionType, Kind, } from 'graphql';
|
|
3
2
|
import { getDefinedRootType, getRootTypeNames } from './rootTypes.js';
|
|
4
3
|
let operationVariables = [];
|
|
5
4
|
let fieldTypeMap = new Map();
|
|
@@ -239,25 +238,6 @@ function resolveVariable(arg, name) {
|
|
|
239
238
|
},
|
|
240
239
|
};
|
|
241
240
|
}
|
|
242
|
-
let defaultValue;
|
|
243
|
-
try {
|
|
244
|
-
const returnVal = astFromValue(arg.defaultValue, arg.type);
|
|
245
|
-
if (returnVal == null) {
|
|
246
|
-
defaultValue = undefined;
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
defaultValue = returnVal;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
catch (e) {
|
|
253
|
-
const returnVal = astFromValueUntyped(arg.defaultValue);
|
|
254
|
-
if (returnVal == null) {
|
|
255
|
-
defaultValue = undefined;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
defaultValue = returnVal;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
241
|
return {
|
|
262
242
|
kind: Kind.VARIABLE_DEFINITION,
|
|
263
243
|
variable: {
|
|
@@ -268,7 +248,6 @@ function resolveVariable(arg, name) {
|
|
|
268
248
|
},
|
|
269
249
|
},
|
|
270
250
|
type: resolveVariableType(arg.type),
|
|
271
|
-
defaultValue,
|
|
272
251
|
};
|
|
273
252
|
}
|
|
274
253
|
function getArgumentName(name, path) {
|
package/esm/mapSchema.js
CHANGED
|
@@ -17,11 +17,10 @@ export function mapSchema(schema, schemaMapper = {}) {
|
|
|
17
17
|
directives,
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
const builtinTypes = ['String', 'ID', 'Int', 'Float', 'Boolean'];
|
|
21
20
|
function mapTypes(originalTypeMap, schema, schemaMapper, testFn = () => true) {
|
|
22
21
|
const newTypeMap = {};
|
|
23
22
|
for (const typeName in originalTypeMap) {
|
|
24
|
-
if (!typeName.startsWith('__')
|
|
23
|
+
if (!typeName.startsWith('__')) {
|
|
25
24
|
const originalType = originalTypeMap[typeName];
|
|
26
25
|
if (originalType == null || !testFn(originalType)) {
|
|
27
26
|
newTypeMap[typeName] = originalType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-tools/utils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-alpha-20250924153515-3751f8516e3574cdd5775626a4f44e799a9c60bc",
|
|
4
4
|
"description": "Common package containing utils and types for GraphQL tools",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|