Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-tools/utils

Package Overview
Dependencies
Maintainers
4
Versions
1301
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/utils - npm Package Compare versions

Comparing version 10.6.2 to 10.6.3

3

cjs/addTypes.js

@@ -30,3 +30,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.addTypes = void 0;
exports.addTypes = addTypes;
const graphql_1 = require("graphql");

@@ -63,2 +63,1 @@ const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js");

}
exports.addTypes = addTypes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.astFromType = void 0;
exports.astFromType = astFromType;
const cross_inspect_1 = require("cross-inspect");

@@ -31,2 +31,1 @@ const graphql_1 = require("graphql");

}
exports.astFromType = astFromType;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.astFromValue = void 0;
exports.astFromValue = astFromValue;
const cross_inspect_1 = require("cross-inspect");

@@ -103,3 +103,2 @@ const graphql_1 = require("graphql");

}
exports.astFromValue = astFromValue;
/**

@@ -106,0 +105,0 @@ * IntValue:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.astFromValueUntyped = void 0;
exports.astFromValueUntyped = astFromValueUntyped;
const graphql_1 = require("graphql");

@@ -79,3 +79,2 @@ /**

}
exports.astFromValueUntyped = astFromValueUntyped;
/**

@@ -82,0 +81,0 @@ * IntValue:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildOperationNodeForField = void 0;
exports.buildOperationNodeForField = buildOperationNodeForField;
const graphql_1 = require("graphql");

@@ -39,3 +39,2 @@ const rootTypes_js_1 = require("./rootTypes.js");

}
exports.buildOperationNodeForField = buildOperationNodeForField;
function buildOperationAndCollectVariables({ schema, fieldName, kind, models, ignore, depthLimit, circularReferenceDepth, argNames, selectedFields, rootTypeNames, }) {

@@ -42,0 +41,0 @@ const type = (0, rootTypes_js_1.getDefinedRootType)(schema, kind);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.collectSubFields = exports.getDeferValues = exports.getFieldEntryKey = exports.doesFragmentConditionMatch = exports.shouldIncludeNode = exports.collectFields = void 0;
exports.collectSubFields = void 0;
exports.collectFields = collectFields;
exports.shouldIncludeNode = shouldIncludeNode;
exports.doesFragmentConditionMatch = doesFragmentConditionMatch;
exports.getFieldEntryKey = getFieldEntryKey;
exports.getDeferValues = getDeferValues;
const graphql_1 = require("graphql");

@@ -83,3 +88,2 @@ const AccumulatorMap_js_1 = require("./AccumulatorMap.js");

}
exports.collectFields = collectFields;
/**

@@ -100,3 +104,2 @@ * Determines if a field should be included based on the `@include` and `@skip`

}
exports.shouldIncludeNode = shouldIncludeNode;
/**

@@ -120,3 +123,2 @@ * Determines if a fragment is applicable to the given type.

}
exports.doesFragmentConditionMatch = doesFragmentConditionMatch;
/**

@@ -128,3 +130,2 @@ * Implements the logic to compute the key of a given field's entry

}
exports.getFieldEntryKey = getFieldEntryKey;
/**

@@ -147,3 +148,2 @@ * Returns an object containing the `@defer` arguments if a field should be

}
exports.getDeferValues = getDeferValues;
/**

@@ -150,0 +150,0 @@ * Given an array of field nodes, collects all of the subfields of the passed

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBlockStringIndentation = exports.dedentBlockStringValue = exports.getLeadingCommentBlock = exports.getComment = exports.getDescription = exports.printWithComments = exports.printComment = exports.pushComment = exports.collectComment = exports.resetComments = void 0;
exports.resetComments = resetComments;
exports.collectComment = collectComment;
exports.pushComment = pushComment;
exports.printComment = printComment;
exports.printWithComments = printWithComments;
exports.getDescription = getDescription;
exports.getComment = getComment;
exports.getLeadingCommentBlock = getLeadingCommentBlock;
exports.dedentBlockStringValue = dedentBlockStringValue;
exports.getBlockStringIndentation = getBlockStringIndentation;
const graphql_1 = require("graphql");

@@ -10,3 +19,2 @@ const MAX_LINE_LENGTH = 80;

}
exports.resetComments = resetComments;
function collectComment(node) {

@@ -42,3 +50,2 @@ const entityName = node.name?.value;

}
exports.collectComment = collectComment;
function pushComment(node, entity, field, argument) {

@@ -62,7 +69,5 @@ const comment = getComment(node);

}
exports.pushComment = pushComment;
function printComment(comment) {
return '\n# ' + comment.replace(/\n/g, '\n# ');
}
exports.printComment = printComment;
/**

@@ -312,3 +317,2 @@ * Copyright (c) 2015-present, Facebook, Inc.

}
exports.printWithComments = printWithComments;
function isFieldDefinitionNode(node) {

@@ -326,3 +330,2 @@ return node.kind === 'FieldDefinition';

}
exports.getDescription = getDescription;
function getComment(node) {

@@ -334,3 +337,2 @@ const rawValue = getLeadingCommentBlock(node);

}
exports.getComment = getComment;
function getLeadingCommentBlock(node) {

@@ -355,3 +357,2 @@ const loc = node.loc;

}
exports.getLeadingCommentBlock = getLeadingCommentBlock;
function dedentBlockStringValue(rawString) {

@@ -377,3 +378,2 @@ // Expand a block string's raw value into independent lines.

}
exports.dedentBlockStringValue = dedentBlockStringValue;
/**

@@ -399,3 +399,2 @@ * @internal

}
exports.getBlockStringIndentation = getBlockStringIndentation;
function leadingWhitespace(str) {

@@ -402,0 +401,0 @@ let i = 0;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDeferred = void 0;
exports.createDeferred = createDeferred;
function createDeferred() {

@@ -16,2 +16,1 @@ if (Promise.withResolvers) {

}
exports.createDeferred = createDeferred;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.debugTimerEnd = exports.debugTimerStart = void 0;
exports.debugTimerStart = debugTimerStart;
exports.debugTimerEnd = debugTimerEnd;
const debugNamesOngoing = new Set();

@@ -12,3 +13,2 @@ function debugTimerStart(name) {

}
exports.debugTimerStart = debugTimerStart;
function debugTimerEnd(name) {

@@ -19,2 +19,1 @@ if (debugNamesOngoing.has(name)) {

}
exports.debugTimerEnd = debugTimerEnd;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDescriptionNode = void 0;
exports.getDescriptionNode = getDescriptionNode;
const graphql_1 = require("graphql");

@@ -20,2 +20,1 @@ function getDescriptionNode(obj) {

}
exports.getDescriptionNode = getDescriptionNode;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.relocatedError = exports.createGraphQLError = void 0;
exports.createGraphQLError = createGraphQLError;
exports.relocatedError = relocatedError;
const graphql_1 = require("graphql");

@@ -33,3 +34,2 @@ const possibleGraphQLErrorProperties = [

}
exports.createGraphQLError = createGraphQLError;
function relocatedError(originalError, path) {

@@ -45,2 +45,1 @@ return createGraphQLError(originalError.message, {

}
exports.relocatedError = relocatedError;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extractExtensionsFromSchema = void 0;
exports.extractExtensionsFromSchema = extractExtensionsFromSchema;
const helpers_js_1 = require("./helpers.js");

@@ -103,2 +103,1 @@ const Interfaces_js_1 = require("./Interfaces.js");

}
exports.extractExtensionsFromSchema = extractExtensionsFromSchema;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fakePromise = exports.fakeRejectPromise = void 0;
exports.fakeRejectPromise = fakeRejectPromise;
exports.fakePromise = fakePromise;
function isPromise(val) {

@@ -30,3 +31,2 @@ return val?.then != null;

}
exports.fakeRejectPromise = fakeRejectPromise;
function fakePromise(value) {

@@ -65,2 +65,1 @@ if (isPromise(value)) {

}
exports.fakePromise = fakePromise;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.modifyObjectFields = exports.selectObjectFields = exports.removeObjectFields = exports.appendObjectFields = void 0;
exports.appendObjectFields = appendObjectFields;
exports.removeObjectFields = removeObjectFields;
exports.selectObjectFields = selectObjectFields;
exports.modifyObjectFields = modifyObjectFields;
const graphql_1 = require("graphql");

@@ -37,3 +40,2 @@ const addTypes_js_1 = require("./addTypes.js");

}
exports.appendObjectFields = appendObjectFields;
function removeObjectFields(schema, typeName, testFn) {

@@ -65,3 +67,2 @@ const removedFields = {};

}
exports.removeObjectFields = removeObjectFields;
function selectObjectFields(schema, typeName, testFn) {

@@ -86,3 +87,2 @@ const selectedFields = {};

}
exports.selectObjectFields = selectObjectFields;
function modifyObjectFields(schema, typeName, testFn, newFields) {

@@ -118,2 +118,1 @@ const removedFields = {};

}
exports.modifyObjectFields = modifyObjectFields;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.filterSchema = void 0;
exports.filterSchema = filterSchema;
const graphql_1 = require("graphql");

@@ -29,3 +29,2 @@ const Interfaces_js_1 = require("./Interfaces.js");

}
exports.filterSchema = filterSchema;
function filterRootFields(type, operation, rootFieldFilter, argumentFilter) {

@@ -32,0 +31,0 @@ if (rootFieldFilter || argumentFilter) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fixSchemaAst = void 0;
exports.fixSchemaAst = fixSchemaAst;
const graphql_1 = require("graphql");

@@ -26,2 +26,1 @@ const print_schema_with_directives_js_1 = require("./print-schema-with-directives.js");

}
exports.fixSchemaAst = fixSchemaAst;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.forEachDefaultValue = void 0;
exports.forEachDefaultValue = forEachDefaultValue;
const graphql_1 = require("graphql");

@@ -29,2 +29,1 @@ function forEachDefaultValue(schema, fn) {

}
exports.forEachDefaultValue = forEachDefaultValue;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.forEachField = void 0;
exports.forEachField = forEachField;
const graphql_1 = require("graphql");

@@ -19,2 +19,1 @@ function forEachField(schema, fn) {

}
exports.forEachField = forEachField;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getArgumentsWithDirectives = void 0;
exports.getArgumentsWithDirectives = getArgumentsWithDirectives;
const graphql_1 = require("graphql");

@@ -32,2 +32,1 @@ function isTypeWithFields(t) {

}
exports.getArgumentsWithDirectives = getArgumentsWithDirectives;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDirective = exports.getDirectives = exports.getDirectiveInExtensions = exports.getDirectivesInExtensions = void 0;
exports.getDirectivesInExtensions = getDirectivesInExtensions;
exports.getDirectiveInExtensions = getDirectiveInExtensions;
exports.getDirectives = getDirectives;
exports.getDirective = getDirective;
const getDirectiveExtensions_js_1 = require("./getDirectiveExtensions.js");

@@ -15,3 +18,2 @@ function getDirectivesInExtensions(node, pathToDirectivesInExtensions = ['directives']) {

}
exports.getDirectivesInExtensions = getDirectivesInExtensions;
function getDirectiveInExtensions(node, directiveName, pathToDirectivesInExtensions = ['directives']) {

@@ -21,3 +23,2 @@ const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, undefined, pathToDirectivesInExtensions);

}
exports.getDirectiveInExtensions = getDirectiveInExtensions;
function getDirectives(schema, node, pathToDirectivesInExtensions = ['directives']) {

@@ -33,3 +34,2 @@ const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions);

}
exports.getDirectives = getDirectives;
function getDirective(schema, node, directiveName, pathToDirectivesInExtensions = ['directives']) {

@@ -39,2 +39,1 @@ const directiveExtensions = (0, getDirectiveExtensions_js_1.getDirectiveExtensions)(node, schema, pathToDirectivesInExtensions);

}
exports.getDirective = getDirective;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFieldsWithDirectives = void 0;
exports.getFieldsWithDirectives = getFieldsWithDirectives;
const graphql_1 = require("graphql");

@@ -31,2 +31,1 @@ function getFieldsWithDirectives(documentNode, options = {}) {

}
exports.getFieldsWithDirectives = getFieldsWithDirectives;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getImplementingTypes = void 0;
exports.getImplementingTypes = getImplementingTypes;
function getImplementingTypes(interfaceName, schema) {

@@ -18,2 +18,1 @@ const allTypesMap = schema.getTypeMap();

}
exports.getImplementingTypes = getImplementingTypes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getArgumentValues = void 0;
exports.getArgumentValues = getArgumentValues;
const cross_inspect_1 = require("cross-inspect");

@@ -72,2 +72,1 @@ const graphql_1 = require("graphql");

}
exports.getArgumentValues = getArgumentValues;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDirectiveExtensions = void 0;
exports.getDirectiveExtensions = getDirectiveExtensions;
const graphql_1 = require("graphql");

@@ -87,2 +87,1 @@ const getArgumentValues_js_1 = require("./getArgumentValues.js");

}
exports.getDirectiveExtensions = getDirectiveExtensions;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getObjectTypeFromTypeMap = void 0;
exports.getObjectTypeFromTypeMap = getObjectTypeFromTypeMap;
const graphql_1 = require("graphql");

@@ -13,2 +13,1 @@ function getObjectTypeFromTypeMap(typeMap, type) {

}
exports.getObjectTypeFromTypeMap = getObjectTypeFromTypeMap;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOperationASTFromRequest = exports.getOperationASTFromDocument = void 0;
exports.getOperationASTFromRequest = void 0;
exports.getOperationASTFromDocument = getOperationASTFromDocument;
const graphql_1 = require("graphql");

@@ -13,5 +14,4 @@ const memoize_js_1 = require("./memoize.js");

}
exports.getOperationASTFromDocument = getOperationASTFromDocument;
exports.getOperationASTFromRequest = (0, memoize_js_1.memoize1)(function getOperationASTFromRequest(request) {
return getOperationASTFromDocument(request.document, request.operationName);
});
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResolversFromSchema = void 0;
exports.getResolversFromSchema = getResolversFromSchema;
const graphql_1 = require("graphql");

@@ -72,2 +72,1 @@ function getResolversFromSchema(schema,

}
exports.getResolversFromSchema = getResolversFromSchema;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getResponseKeyFromInfo = void 0;
exports.getResponseKeyFromInfo = getResponseKeyFromInfo;
/**

@@ -12,2 +12,1 @@ * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just

}
exports.getResponseKeyFromInfo = getResponseKeyFromInfo;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.healTypes = exports.healSchema = void 0;
exports.healSchema = healSchema;
exports.healTypes = healTypes;
const graphql_1 = require("graphql");

@@ -37,3 +38,2 @@ // Update any references to named schema types that disagree with the named

}
exports.healSchema = healSchema;
function healTypes(originalTypeMap, directives) {

@@ -179,2 +179,1 @@ const actualNamedTypeMap = Object.create(null);

}
exports.healTypes = healTypes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertSome = exports.isSome = exports.compareNodes = exports.nodeToString = exports.compareStrings = exports.isValidPath = exports.isDocumentString = exports.asArray = void 0;
exports.asArray = void 0;
exports.isDocumentString = isDocumentString;
exports.isValidPath = isValidPath;
exports.compareStrings = compareStrings;
exports.nodeToString = nodeToString;
exports.compareNodes = compareNodes;
exports.isSome = isSome;
exports.assertSome = assertSome;
const graphql_1 = require("graphql");

@@ -42,3 +49,2 @@ function isURL(str) {

}
exports.isDocumentString = isDocumentString;
const invalidPathRegex = /[‘“!%^<>`\n]/;

@@ -56,3 +62,2 @@ /**

}
exports.isValidPath = isValidPath;
function compareStrings(a, b) {

@@ -67,3 +72,2 @@ if (String(a) < String(b)) {

}
exports.compareStrings = compareStrings;
function nodeToString(a) {

@@ -82,3 +86,2 @@ let name;

}
exports.nodeToString = nodeToString;
function compareNodes(a, b, customFn) {

@@ -92,7 +95,5 @@ const aStr = nodeToString(a);

}
exports.compareNodes = compareNodes;
function isSome(input) {
return input != null;
}
exports.isSome = isSome;
function assertSome(input, message = 'Value should be something') {

@@ -103,2 +104,1 @@ if (input == null) {

}
exports.assertSome = assertSome;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.implementsAbstractType = void 0;
exports.implementsAbstractType = implementsAbstractType;
const graphql_1 = require("graphql");

@@ -17,2 +17,1 @@ function implementsAbstractType(schema, typeA, typeB) {

}
exports.implementsAbstractType = implementsAbstractType;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isAsyncIterable = void 0;
exports.isAsyncIterable = isAsyncIterable;
function isAsyncIterable(value) {
return value?.[Symbol.asyncIterator] != null;
}
exports.isAsyncIterable = isAsyncIterable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDocumentNode = void 0;
exports.isDocumentNode = isDocumentNode;
const graphql_1 = require("graphql");

@@ -8,2 +8,1 @@ function isDocumentNode(object) {

}
exports.isDocumentNode = isDocumentNode;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasOwnProperty = exports.promiseReduce = exports.isPromise = exports.isObjectLike = exports.isIterableObject = void 0;
exports.isIterableObject = isIterableObject;
exports.isObjectLike = isObjectLike;
exports.isPromise = isPromise;
exports.promiseReduce = promiseReduce;
exports.hasOwnProperty = hasOwnProperty;
const map_maybe_promise_js_1 = require("./map-maybe-promise.js");

@@ -8,11 +12,8 @@ function isIterableObject(value) {

}
exports.isIterableObject = isIterableObject;
function isObjectLike(value) {
return typeof value === 'object' && value !== null;
}
exports.isObjectLike = isObjectLike;
function isPromise(value) {
return value?.then != null;
}
exports.isPromise = isPromise;
function promiseReduce(values, callbackFn, initialValue) {

@@ -25,6 +26,4 @@ let accumulator = initialValue;

}
exports.promiseReduce = promiseReduce;
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
exports.hasOwnProperty = hasOwnProperty;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapMaybePromise = void 0;
exports.mapMaybePromise = mapMaybePromise;
const jsutils_js_1 = require("./jsutils.js");

@@ -27,2 +27,1 @@ function mapMaybePromise(value, mapper, errorMapper) {

}
exports.mapMaybePromise = mapMaybePromise;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapAsyncIterator = void 0;
exports.mapAsyncIterator = mapAsyncIterator;
const fakePromise_js_1 = require("./fakePromise.js");

@@ -73,5 +73,4 @@ const map_maybe_promise_js_1 = require("./map-maybe-promise.js");

}
exports.mapAsyncIterator = mapAsyncIterator;
function iteratorResult(value) {
return { value, done: false };
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.correctASTNodes = exports.mapSchema = void 0;
exports.mapSchema = mapSchema;
exports.correctASTNodes = correctASTNodes;
const graphql_1 = require("graphql");

@@ -23,3 +24,2 @@ const getObjectTypeFromTypeMap_js_1 = require("./getObjectTypeFromTypeMap.js");

}
exports.mapSchema = mapSchema;
function mapTypes(originalTypeMap, schema, schemaMapper, testFn = () => true) {

@@ -472,2 +472,1 @@ const newTypeMap = {};

}
exports.correctASTNodes = correctASTNodes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.memoize2of5 = exports.memoize2of4 = exports.memoize5 = exports.memoize4 = exports.memoize3 = exports.memoize2 = exports.memoize1 = void 0;
exports.memoize1 = memoize1;
exports.memoize2 = memoize2;
exports.memoize3 = memoize3;
exports.memoize4 = memoize4;
exports.memoize5 = memoize5;
exports.memoize2of4 = memoize2of4;
exports.memoize2of5 = memoize2of5;
function memoize1(fn) {

@@ -16,3 +22,2 @@ const memoize1cache = new WeakMap();

}
exports.memoize1 = memoize1;
function memoize2(fn) {

@@ -38,3 +43,2 @@ const memoize2cache = new WeakMap();

}
exports.memoize2 = memoize2;
function memoize3(fn) {

@@ -70,3 +74,2 @@ const memoize3Cache = new WeakMap();

}
exports.memoize3 = memoize3;
function memoize4(fn) {

@@ -114,3 +117,2 @@ const memoize4Cache = new WeakMap();

}
exports.memoize4 = memoize4;
function memoize5(fn) {

@@ -172,3 +174,2 @@ const memoize5Cache = new WeakMap();

}
exports.memoize5 = memoize5;
function memoize2of4(fn) {

@@ -194,3 +195,2 @@ const memoize2of4cache = new WeakMap();

}
exports.memoize2of4 = memoize2of4;
function memoize2of5(fn) {

@@ -216,2 +216,1 @@ const memoize2of4cache = new WeakMap();

}
exports.memoize2of5 = memoize2of5;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeDeep = void 0;
exports.mergeDeep = mergeDeep;
const helpers_js_1 = require("./helpers.js");

@@ -80,5 +80,4 @@ function mergeDeep(sources, respectPrototype = false, respectArrays = false, respectArrayLength = false) {

}
exports.mergeDeep = mergeDeep;
function isObject(item) {
return item && typeof item === 'object' && !Array.isArray(item);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeIncrementalResult = void 0;
exports.mergeIncrementalResult = mergeIncrementalResult;
const merge_1 = require("dset/merge");

@@ -33,2 +33,1 @@ function mergeIncrementalResult({ incrementalResult, executionResult, }) {

}
exports.mergeIncrementalResult = mergeIncrementalResult;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.observableToAsyncIterable = void 0;
exports.observableToAsyncIterable = observableToAsyncIterable;
const fakePromise_js_1 = require("./fakePromise.js");

@@ -86,2 +86,1 @@ function observableToAsyncIterable(observable) {

}
exports.observableToAsyncIterable = observableToAsyncIterable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseGraphQLJSON = void 0;
exports.parseGraphQLJSON = parseGraphQLJSON;
const graphql_1 = require("graphql");

@@ -44,2 +44,1 @@ function stripBOM(content) {

}
exports.parseGraphQLJSON = parseGraphQLJSON;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDescribable = exports.transformCommentsToDescriptions = exports.parseGraphQLSDL = void 0;
exports.parseGraphQLSDL = parseGraphQLSDL;
exports.transformCommentsToDescriptions = transformCommentsToDescriptions;
exports.isDescribable = isDescribable;
const graphql_1 = require("graphql");

@@ -38,3 +40,2 @@ const comments_js_1 = require("./comments.js");

}
exports.parseGraphQLSDL = parseGraphQLSDL;
function transformCommentsToDescriptions(sourceSdl, options = {}) {

@@ -78,3 +79,2 @@ const parsedDoc = (0, graphql_1.parse)(sourceSdl, {

}
exports.transformCommentsToDescriptions = transformCommentsToDescriptions;
function isDescribable(node) {

@@ -86,2 +86,1 @@ return ((0, graphql_1.isTypeSystemDefinitionNode)(node) ||

}
exports.isDescribable = isDescribable;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.printPathArray = exports.pathToArray = exports.addPath = void 0;
exports.addPath = addPath;
exports.pathToArray = pathToArray;
exports.printPathArray = printPathArray;
/**

@@ -10,3 +12,2 @@ * Given a Path and a key, return a new Path containing the new key.

}
exports.addPath = addPath;
/**

@@ -24,3 +25,2 @@ * Given a Path, return an Array of the path keys.

}
exports.pathToArray = pathToArray;
/**

@@ -34,2 +34,1 @@ * Build a string describing the path.

}
exports.printPathArray = printPathArray;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.makeDirectiveNodes = exports.makeDirectiveNode = exports.makeDeprecatedDirective = exports.astFromEnumValue = exports.astFromInputField = exports.astFromField = exports.astFromScalarType = exports.astFromEnumType = exports.astFromInputObjectType = exports.astFromUnionType = exports.astFromInterfaceType = exports.astFromObjectType = exports.astFromArg = exports.getDirectiveNodes = exports.astFromDirective = exports.astFromSchema = exports.printSchemaWithDirectives = exports.getDocumentNodeFromSchema = void 0;
exports.getDocumentNodeFromSchema = getDocumentNodeFromSchema;
exports.printSchemaWithDirectives = printSchemaWithDirectives;
exports.astFromSchema = astFromSchema;
exports.astFromDirective = astFromDirective;
exports.getDirectiveNodes = getDirectiveNodes;
exports.astFromArg = astFromArg;
exports.astFromObjectType = astFromObjectType;
exports.astFromInterfaceType = astFromInterfaceType;
exports.astFromUnionType = astFromUnionType;
exports.astFromInputObjectType = astFromInputObjectType;
exports.astFromEnumType = astFromEnumType;
exports.astFromScalarType = astFromScalarType;
exports.astFromField = astFromField;
exports.astFromInputField = astFromInputField;
exports.astFromEnumValue = astFromEnumValue;
exports.makeDeprecatedDirective = makeDeprecatedDirective;
exports.makeDirectiveNode = makeDirectiveNode;
exports.makeDirectiveNodes = makeDirectiveNodes;
const graphql_1 = require("graphql");

@@ -58,3 +75,2 @@ const astFromType_js_1 = require("./astFromType.js");

}
exports.getDocumentNodeFromSchema = getDocumentNodeFromSchema;
// this approach uses the default schema printer rather than a custom solution, so may be more backwards compatible

@@ -66,3 +82,2 @@ // currently does not allow customization of printSchema options having to do with comments.

}
exports.printSchemaWithDirectives = printSchemaWithDirectives;
function astFromSchema(schema, pathToDirectivesInExtensions) {

@@ -124,3 +139,2 @@ const operationTypeMap = new Map([

}
exports.astFromSchema = astFromSchema;
function astFromDirective(directive, schema, pathToDirectivesInExtensions) {

@@ -142,3 +156,2 @@ return {

}
exports.astFromDirective = astFromDirective;
function getDirectiveNodes(entity, schema, pathToDirectivesInExtensions) {

@@ -181,3 +194,2 @@ let directiveNodesBesidesDeprecatedAndSpecifiedBy = [];

}
exports.getDirectiveNodes = getDirectiveNodes;
function astFromArg(arg, schema, pathToDirectivesInExtensions) {

@@ -199,3 +211,2 @@ return {

}
exports.astFromArg = astFromArg;
function astFromObjectType(type, schema, pathToDirectivesInExtensions) {

@@ -214,3 +225,2 @@ return {

}
exports.astFromObjectType = astFromObjectType;
function astFromInterfaceType(type, schema, pathToDirectivesInExtensions) {

@@ -232,3 +242,2 @@ const node = {

}
exports.astFromInterfaceType = astFromInterfaceType;
function astFromUnionType(type, schema, pathToDirectivesInExtensions) {

@@ -247,3 +256,2 @@ return {

}
exports.astFromUnionType = astFromUnionType;
function astFromInputObjectType(type, schema, pathToDirectivesInExtensions) {

@@ -262,3 +270,2 @@ return {

}
exports.astFromInputObjectType = astFromInputObjectType;
function astFromEnumType(type, schema, pathToDirectivesInExtensions) {

@@ -277,3 +284,2 @@ return {

}
exports.astFromEnumType = astFromEnumType;
function astFromScalarType(type, schema, pathToDirectivesInExtensions) {

@@ -302,3 +308,2 @@ const directivesInExtensions = (0, get_directives_js_1.getDirectivesInExtensions)(type, pathToDirectivesInExtensions);

}
exports.astFromScalarType = astFromScalarType;
function astFromField(field, schema, pathToDirectivesInExtensions) {

@@ -318,3 +323,2 @@ return {

}
exports.astFromField = astFromField;
function astFromInputField(field, schema, pathToDirectivesInExtensions) {

@@ -334,3 +338,2 @@ return {

}
exports.astFromInputField = astFromInputField;
function astFromEnumValue(value, schema, pathToDirectivesInExtensions) {

@@ -347,7 +350,5 @@ return {

}
exports.astFromEnumValue = astFromEnumValue;
function makeDeprecatedDirective(deprecationReason) {
return makeDirectiveNode('deprecated', { reason: deprecationReason }, graphql_1.GraphQLDeprecatedDirective);
}
exports.makeDeprecatedDirective = makeDeprecatedDirective;
function makeDirectiveNode(name, args, directive) {

@@ -387,3 +388,2 @@ const directiveArguments = [];

}
exports.makeDirectiveNode = makeDirectiveNode;
function makeDirectiveNodes(schema, directiveValues) {

@@ -397,2 +397,1 @@ const directiveNodes = [];

}
exports.makeDirectiveNodes = makeDirectiveNodes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pruneSchema = void 0;
exports.pruneSchema = pruneSchema;
const graphql_1 = require("graphql");

@@ -75,3 +75,2 @@ const get_implementing_types_js_1 = require("./get-implementing-types.js");

}
exports.pruneSchema = pruneSchema;
function visitSchema(schema) {

@@ -78,0 +77,0 @@ const queue = []; // queue of nodes to visit

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renameType = void 0;
exports.renameType = renameType;
const graphql_1 = require("graphql");

@@ -152,2 +152,1 @@ function renameType(type, newTypeName) {

}
exports.renameType = renameType;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rewireTypes = void 0;
exports.rewireTypes = rewireTypes;
const graphql_1 = require("graphql");

@@ -160,2 +160,1 @@ const stub_js_1 = require("./stub.js");

}
exports.rewireTypes = rewireTypes;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRootTypeMap = exports.getRootTypes = exports.getRootTypeNames = exports.getDefinedRootType = void 0;
exports.getRootTypeMap = exports.getRootTypes = exports.getRootTypeNames = void 0;
exports.getDefinedRootType = getDefinedRootType;
const errors_js_1 = require("./errors.js");

@@ -16,3 +17,2 @@ const memoize_js_1 = require("./memoize.js");

}
exports.getDefinedRootType = getDefinedRootType;
exports.getRootTypeNames = (0, memoize_js_1.memoize1)(function getRootTypeNames(schema) {

@@ -19,0 +19,0 @@ const rootTypes = (0, exports.getRootTypes)(schema);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseSelectionSet = void 0;
exports.parseSelectionSet = parseSelectionSet;
const graphql_1 = require("graphql");

@@ -9,2 +9,1 @@ function parseSelectionSet(selectionSet, options) {

}
exports.parseSelectionSet = parseSelectionSet;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBuiltInForStub = exports.isNamedStub = exports.createStub = exports.createNamedStub = void 0;
exports.createNamedStub = createNamedStub;
exports.createStub = createStub;
exports.isNamedStub = isNamedStub;
exports.getBuiltInForStub = getBuiltInForStub;
const graphql_1 = require("graphql");

@@ -25,3 +28,2 @@ function createNamedStub(name, type) {

}
exports.createNamedStub = createNamedStub;
function createStub(node, type) {

@@ -40,3 +42,2 @@ switch (node.kind) {

}
exports.createStub = createStub;
function isNamedStub(type) {

@@ -53,3 +54,2 @@ if ('getFields' in type) {

}
exports.isNamedStub = isNamedStub;
function getBuiltInForStub(type) {

@@ -71,2 +71,1 @@ switch (type.name) {

}
exports.getBuiltInForStub = getBuiltInForStub;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseInputValueLiteral = exports.parseInputValue = exports.serializeInputValue = exports.transformInputValue = void 0;
exports.transformInputValue = transformInputValue;
exports.serializeInputValue = serializeInputValue;
exports.parseInputValue = parseInputValue;
exports.parseInputValueLiteral = parseInputValueLiteral;
const graphql_1 = require("graphql");

@@ -34,3 +37,2 @@ const helpers_js_1 = require("./helpers.js");

}
exports.transformInputValue = transformInputValue;
function serializeInputValue(type, value) {

@@ -46,3 +48,2 @@ return transformInputValue(type, value, (t, v) => {

}
exports.serializeInputValue = serializeInputValue;
function parseInputValue(type, value) {

@@ -58,6 +59,4 @@ return transformInputValue(type, value, (t, v) => {

}
exports.parseInputValue = parseInputValue;
function parseInputValueLiteral(type, value) {
return transformInputValue(type, value, (t, v) => t.parseLiteral(v, {}));
}
exports.parseInputValueLiteral = parseInputValueLiteral;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createVariableNameGenerator = exports.updateArgument = void 0;
exports.updateArgument = updateArgument;
exports.createVariableNameGenerator = createVariableNameGenerator;
const graphql_1 = require("graphql");

@@ -43,3 +44,2 @@ const astFromType_js_1 = require("./astFromType.js");

}
exports.updateArgument = updateArgument;
function createVariableNameGenerator(variableDefinitionMap) {

@@ -55,2 +55,1 @@ let varCounter = 0;

}
exports.createVariableNameGenerator = createVariableNameGenerator;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDefaultRules = exports.validateGraphQlDocuments = void 0;
exports.validateGraphQlDocuments = validateGraphQlDocuments;
exports.createDefaultRules = createDefaultRules;
const graphql_1 = require("graphql");

@@ -33,3 +34,2 @@ function validateGraphQlDocuments(schema, documents, rules = createDefaultRules()) {

}
exports.validateGraphQlDocuments = validateGraphQlDocuments;
function createDefaultRules() {

@@ -42,2 +42,1 @@ let ignored = ['NoUnusedFragmentsRule', 'NoUnusedVariablesRule', 'KnownDirectivesRule'];

}
exports.createDefaultRules = createDefaultRules;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.valueMatchesCriteria = void 0;
exports.valueMatchesCriteria = valueMatchesCriteria;
function valueMatchesCriteria(value, criteria) {

@@ -22,2 +22,1 @@ if (value == null) {

}
exports.valueMatchesCriteria = valueMatchesCriteria;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.visitResult = exports.visitErrors = exports.visitData = void 0;
exports.visitData = visitData;
exports.visitErrors = visitErrors;
exports.visitResult = visitResult;
const graphql_1 = require("graphql");

@@ -25,7 +27,5 @@ const collectFields_js_1 = require("./collectFields.js");

}
exports.visitData = visitData;
function visitErrors(errors, visitor) {
return errors.map(error => visitor(error));
}
exports.visitErrors = visitErrors;
function visitResult(result, request, schema, resultVisitorMap, errorVisitorMap) {

@@ -55,3 +55,2 @@ const fragments = request.document.definitions.reduce((acc, def) => {

}
exports.visitResult = visitResult;
function visitErrorsByType(errors, errorVisitorMap, errorInfo) {

@@ -58,0 +57,0 @@ const segmentInfoMap = errorInfo.segmentInfoMap;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.withCancel = exports.getAsyncIterableWithCancel = exports.getAsyncIteratorWithCancel = void 0;
exports.getAsyncIteratorWithCancel = getAsyncIteratorWithCancel;
exports.getAsyncIterableWithCancel = getAsyncIterableWithCancel;
exports.withCancel = getAsyncIterableWithCancel;
const memoize_js_1 = require("./memoize.js");

@@ -37,3 +39,2 @@ async function defaultAsyncIteratorReturn(value) {

}
exports.getAsyncIteratorWithCancel = getAsyncIteratorWithCancel;
function getAsyncIterableWithCancel(asyncIterable, onCancel) {

@@ -56,3 +57,1 @@ return new Proxy(asyncIterable, {

}
exports.getAsyncIterableWithCancel = getAsyncIterableWithCancel;
exports.withCancel = getAsyncIterableWithCancel;
{
"name": "@graphql-tools/utils",
"version": "10.6.2",
"version": "10.6.3",
"description": "Common package containing utils and types for GraphQL tools",

@@ -5,0 +5,0 @@ "sideEffects": false,

@@ -1,2 +0,2 @@

import { GraphQLResolveInfo } from 'graphql';
import { GraphQLResolveInfo } from './Interfaces.js';
/**

@@ -3,0 +3,0 @@ * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just

@@ -1,2 +0,2 @@

import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLResolveInfo, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
import { DefinitionNode, DocumentNode, EnumTypeDefinitionNode, EnumTypeExtensionNode, FieldDefinitionNode, FieldNode, FragmentDefinitionNode, GraphQLArgument, GraphQLArgumentConfig, GraphQLDirective, GraphQLEnumType, GraphQLEnumValue, GraphQLEnumValueConfig, GraphQLError, GraphQLField, GraphQLFieldConfig, GraphQLInputField, GraphQLInputFieldConfig, GraphQLInputObjectType, GraphQLInputType, GraphQLInterfaceType, GraphQLIsTypeOfFn, GraphQLNamedType, GraphQLObjectType, GraphQLOutputType, GraphQLScalarLiteralParser, GraphQLScalarSerializer, GraphQLScalarType, GraphQLScalarValueParser, GraphQLSchema, GraphQLType, GraphQLTypeResolver, GraphQLUnionType, InputObjectTypeDefinitionNode, InputObjectTypeExtensionNode, InterfaceTypeDefinitionNode, InterfaceTypeExtensionNode, ObjectTypeDefinitionNode, ObjectTypeExtensionNode, OperationTypeNode, GraphQLResolveInfo as OrigGraphQLResolveInfo, ScalarTypeDefinitionNode, ScalarTypeExtensionNode, SelectionNode, Source, UnionTypeDefinitionNode, UnionTypeExtensionNode } from 'graphql';
import { TypedDocumentNode } from '@graphql-typed-document-node/core';

@@ -21,2 +21,5 @@ /**

}
export interface GraphQLResolveInfo extends OrigGraphQLResolveInfo {
signal?: AbortSignal;
}
export interface ExecutionRequest<TVariables extends Record<string, any> = any, TContext = any, TRootValue = any, TExtensions = Record<string, any>, TReturn = any> {

@@ -31,2 +34,3 @@ document: TypedDocumentNode<TReturn, TVariables>;

info?: GraphQLResolveInfo;
signal?: AbortSignal;
}

@@ -33,0 +37,0 @@ export interface GraphQLParseOptions {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc