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

@graphql-tools/import

Package Overview
Dependencies
Maintainers
3
Versions
863
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/import - npm Package Compare versions

Comparing version 7.0.0-rc-20230519104353-b09f3180 to 7.0.0-rc-20230519104627-f6fea064

96

cjs/index.js

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

}
return (definitionsStr === null || definitionsStr === void 0 ? void 0 : definitionsStr.length)
return definitionsStr?.length
? (0, graphql_1.parse)(new graphql_1.Source(definitionsStr, filePath))

@@ -74,3 +74,3 @@ : {

const dependencyDefinitionForDocument = allImportedDefinitionsMap.get(documentName);
dependencyDefinitionForDocument === null || dependencyDefinitionForDocument === void 0 ? void 0 : dependencyDefinitionForDocument.forEach(node => {
dependencyDefinitionForDocument?.forEach(node => {
if (node !== definition) {

@@ -87,3 +87,3 @@ addDefinition(node, definitionName, definitionSet);

const allImportedDefinitions = allImportedDefinitionsMap.get(definitionName);
allImportedDefinitions === null || allImportedDefinitions === void 0 ? void 0 : allImportedDefinitions.forEach(importedDefinition => {
allImportedDefinitions?.forEach(importedDefinition => {
if (!fileDefinitionMap.has(fieldDefinitionName)) {

@@ -108,7 +108,7 @@ fileDefinitionMap.set(fieldDefinitionName, new Set());

const definitionsInCurrentFile = fileDefinitionMap.get(dependencyName);
definitionsInCurrentFile === null || definitionsInCurrentFile === void 0 ? void 0 : definitionsInCurrentFile.forEach(def => addDefinition(def, definitionName, definitionSet));
definitionsInCurrentFile?.forEach(def => addDefinition(def, definitionName, definitionSet));
const definitionsFromImports = allImportedDefinitionsMap.get(dependencyName);
definitionsFromImports === null || definitionsFromImports === void 0 ? void 0 : definitionsFromImports.forEach(def => addDefinition(def, definitionName, definitionSet));
definitionsFromImports?.forEach(def => addDefinition(def, definitionName, definitionSet));
const transitiveDependencies = potentialTransitiveDefinitionsMap.get(dependencyName);
transitiveDependencies === null || transitiveDependencies === void 0 ? void 0 : transitiveDependencies.forEach(def => addDefinition(def, definitionName, definitionSet));
transitiveDependencies?.forEach(def => addDefinition(def, definitionName, definitionSet));
});

@@ -129,3 +129,3 @@ }

const allImportedDefinitions = allImportedDefinitionsMap.get(definitionName);
allImportedDefinitions === null || allImportedDefinitions === void 0 ? void 0 : allImportedDefinitions.forEach(importedDefinition => {
allImportedDefinitions?.forEach(importedDefinition => {
addDefinition(importedDefinition, definitionName, definitionsWithDependencies);

@@ -141,3 +141,3 @@ });

const dependencyDefinitionsFromImports = allImportedDefinitionsMap.get(dependencyName);
dependencyDefinitionsFromImports === null || dependencyDefinitionsFromImports === void 0 ? void 0 : dependencyDefinitionsFromImports.forEach(dependencyDefinition => {
dependencyDefinitionsFromImports?.forEach(dependencyDefinition => {
// addDefinition will add recursively all dependent documents for dependencyName document

@@ -175,3 +175,2 @@ if ('name' in dependencyDefinition &&

function visitDefinition(definition, definitionsByName, dependenciesByDefinitionName) {
var _a;
// TODO: handle queries without names

@@ -246,3 +245,3 @@ if ('name' in definition || definition.kind === graphql_1.Kind.SCHEMA_DEFINITION) {

}
(_a = definitionsByName.get(definitionName)) === null || _a === void 0 ? void 0 : _a.add({
definitionsByName.get(definitionName)?.add({
...definition,

@@ -411,4 +410,3 @@ fields: [field],

function visitOperationDefinitionNode(node, dependencySet) {
var _a;
if ((_a = node.name) === null || _a === void 0 ? void 0 : _a.value) {
if (node.name?.value) {
dependencySet.add(node.name.value);

@@ -432,4 +430,3 @@ }

function visitFieldNode(node, dependencySet) {
var _a;
(_a = node.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach(selectionNode => visitSelectionNode(selectionNode, dependencySet));
node.selectionSet?.selections.forEach(selectionNode => visitSelectionNode(selectionNode, dependencySet));
}

@@ -447,3 +444,2 @@ function visitFragmentSpreadNode(node, dependencySet) {

function addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;

@@ -453,5 +449,5 @@ // all interfaces should be dependent to each other

typeName,
...(((_a = node.interfaces) === null || _a === void 0 ? void 0 : _a.map((namedTypeNode) => namedTypeNode.name.value)) || []),
...(node.interfaces?.map((namedTypeNode) => namedTypeNode.name.value) || []),
];
(_b = node.interfaces) === null || _b === void 0 ? void 0 : _b.forEach((namedTypeNode) => {
node.interfaces?.forEach((namedTypeNode) => {
visitNamedTypeNode(namedTypeNode, dependencySet);

@@ -473,7 +469,6 @@ const interfaceName = namedTypeNode.name.value;

function visitObjectTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);

@@ -488,5 +483,4 @@ }

function visitFieldDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
(_a = node.arguments) === null || _a === void 0 ? void 0 : _a.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
(_b = node.directives) === null || _b === void 0 ? void 0 : _b.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.arguments?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
visitTypeNode(node.type, dependencySet, dependenciesByDefinitionName);

@@ -520,84 +514,70 @@ }

function visitInputValueDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a;
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
visitTypeNode(node.type, dependencySet, dependenciesByDefinitionName);
}
function visitInterfaceTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitUnionTypeDefinitionNode(node, dependencySet) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.types) === null || _b === void 0 ? void 0 : _b.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.types?.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
}
function visitEnumTypeDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitInputObjectTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitDirectiveDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a;
dependencySet.add(node.name.value);
(_a = node.arguments) === null || _a === void 0 ? void 0 : _a.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.arguments?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitObjectTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitInterfaceTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitUnionTypeExtensionNode(node, dependencySet) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.types) === null || _b === void 0 ? void 0 : _b.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.types?.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
}
function visitEnumTypeExtensionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitInputObjectTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitSchemaDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add('schema');
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.operationTypes.forEach(operationTypeDefinitionNode => visitOperationTypeDefinitionNode(operationTypeDefinitionNode, dependencySet));
}
function visitScalarDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitScalarExtensionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}

@@ -604,0 +584,0 @@ function visitOperationTypeDefinitionNode(node, dependencySet) {

@@ -41,3 +41,3 @@ import { Source, parse, Kind, print, } from 'graphql';

}
return (definitionsStr === null || definitionsStr === void 0 ? void 0 : definitionsStr.length)
return definitionsStr?.length
? parse(new Source(definitionsStr, filePath))

@@ -69,3 +69,3 @@ : {

const dependencyDefinitionForDocument = allImportedDefinitionsMap.get(documentName);
dependencyDefinitionForDocument === null || dependencyDefinitionForDocument === void 0 ? void 0 : dependencyDefinitionForDocument.forEach(node => {
dependencyDefinitionForDocument?.forEach(node => {
if (node !== definition) {

@@ -82,3 +82,3 @@ addDefinition(node, definitionName, definitionSet);

const allImportedDefinitions = allImportedDefinitionsMap.get(definitionName);
allImportedDefinitions === null || allImportedDefinitions === void 0 ? void 0 : allImportedDefinitions.forEach(importedDefinition => {
allImportedDefinitions?.forEach(importedDefinition => {
if (!fileDefinitionMap.has(fieldDefinitionName)) {

@@ -103,7 +103,7 @@ fileDefinitionMap.set(fieldDefinitionName, new Set());

const definitionsInCurrentFile = fileDefinitionMap.get(dependencyName);
definitionsInCurrentFile === null || definitionsInCurrentFile === void 0 ? void 0 : definitionsInCurrentFile.forEach(def => addDefinition(def, definitionName, definitionSet));
definitionsInCurrentFile?.forEach(def => addDefinition(def, definitionName, definitionSet));
const definitionsFromImports = allImportedDefinitionsMap.get(dependencyName);
definitionsFromImports === null || definitionsFromImports === void 0 ? void 0 : definitionsFromImports.forEach(def => addDefinition(def, definitionName, definitionSet));
definitionsFromImports?.forEach(def => addDefinition(def, definitionName, definitionSet));
const transitiveDependencies = potentialTransitiveDefinitionsMap.get(dependencyName);
transitiveDependencies === null || transitiveDependencies === void 0 ? void 0 : transitiveDependencies.forEach(def => addDefinition(def, definitionName, definitionSet));
transitiveDependencies?.forEach(def => addDefinition(def, definitionName, definitionSet));
});

@@ -124,3 +124,3 @@ }

const allImportedDefinitions = allImportedDefinitionsMap.get(definitionName);
allImportedDefinitions === null || allImportedDefinitions === void 0 ? void 0 : allImportedDefinitions.forEach(importedDefinition => {
allImportedDefinitions?.forEach(importedDefinition => {
addDefinition(importedDefinition, definitionName, definitionsWithDependencies);

@@ -136,3 +136,3 @@ });

const dependencyDefinitionsFromImports = allImportedDefinitionsMap.get(dependencyName);
dependencyDefinitionsFromImports === null || dependencyDefinitionsFromImports === void 0 ? void 0 : dependencyDefinitionsFromImports.forEach(dependencyDefinition => {
dependencyDefinitionsFromImports?.forEach(dependencyDefinition => {
// addDefinition will add recursively all dependent documents for dependencyName document

@@ -169,3 +169,2 @@ if ('name' in dependencyDefinition &&

function visitDefinition(definition, definitionsByName, dependenciesByDefinitionName) {
var _a;
// TODO: handle queries without names

@@ -240,3 +239,3 @@ if ('name' in definition || definition.kind === Kind.SCHEMA_DEFINITION) {

}
(_a = definitionsByName.get(definitionName)) === null || _a === void 0 ? void 0 : _a.add({
definitionsByName.get(definitionName)?.add({
...definition,

@@ -402,4 +401,3 @@ fields: [field],

function visitOperationDefinitionNode(node, dependencySet) {
var _a;
if ((_a = node.name) === null || _a === void 0 ? void 0 : _a.value) {
if (node.name?.value) {
dependencySet.add(node.name.value);

@@ -423,4 +421,3 @@ }

function visitFieldNode(node, dependencySet) {
var _a;
(_a = node.selectionSet) === null || _a === void 0 ? void 0 : _a.selections.forEach(selectionNode => visitSelectionNode(selectionNode, dependencySet));
node.selectionSet?.selections.forEach(selectionNode => visitSelectionNode(selectionNode, dependencySet));
}

@@ -438,3 +435,2 @@ function visitFragmentSpreadNode(node, dependencySet) {

function addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;

@@ -444,5 +440,5 @@ // all interfaces should be dependent to each other

typeName,
...(((_a = node.interfaces) === null || _a === void 0 ? void 0 : _a.map((namedTypeNode) => namedTypeNode.name.value)) || []),
...(node.interfaces?.map((namedTypeNode) => namedTypeNode.name.value) || []),
];
(_b = node.interfaces) === null || _b === void 0 ? void 0 : _b.forEach((namedTypeNode) => {
node.interfaces?.forEach((namedTypeNode) => {
visitNamedTypeNode(namedTypeNode, dependencySet);

@@ -464,7 +460,6 @@ const interfaceName = namedTypeNode.name.value;

function visitObjectTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);

@@ -479,5 +474,4 @@ }

function visitFieldDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
(_a = node.arguments) === null || _a === void 0 ? void 0 : _a.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
(_b = node.directives) === null || _b === void 0 ? void 0 : _b.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.arguments?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
visitTypeNode(node.type, dependencySet, dependenciesByDefinitionName);

@@ -511,84 +505,70 @@ }

function visitInputValueDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a;
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
visitTypeNode(node.type, dependencySet, dependenciesByDefinitionName);
}
function visitInterfaceTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitUnionTypeDefinitionNode(node, dependencySet) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.types) === null || _b === void 0 ? void 0 : _b.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.types?.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
}
function visitEnumTypeDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitInputObjectTypeDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitDirectiveDefinitionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a;
dependencySet.add(node.name.value);
(_a = node.arguments) === null || _a === void 0 ? void 0 : _a.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.arguments?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitObjectTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitInterfaceTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
const typeName = node.name.value;
dependencySet.add(typeName);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(fieldDefinitionNode => visitFieldDefinitionNode(fieldDefinitionNode, dependencySet, dependenciesByDefinitionName));
addInterfaceDependencies(node, dependencySet, dependenciesByDefinitionName);
}
function visitUnionTypeExtensionNode(node, dependencySet) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.types) === null || _b === void 0 ? void 0 : _b.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.types?.forEach(namedTypeNode => visitNamedTypeNode(namedTypeNode, dependencySet));
}
function visitEnumTypeExtensionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitInputObjectTypeExtensionNode(node, dependencySet, dependenciesByDefinitionName) {
var _a, _b;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
(_b = node.fields) === null || _b === void 0 ? void 0 : _b.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.fields?.forEach(inputValueDefinitionNode => visitInputValueDefinitionNode(inputValueDefinitionNode, dependencySet, dependenciesByDefinitionName));
}
function visitSchemaDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add('schema');
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.operationTypes.forEach(operationTypeDefinitionNode => visitOperationTypeDefinitionNode(operationTypeDefinitionNode, dependencySet));
}
function visitScalarDefinitionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}
function visitScalarExtensionNode(node, dependencySet) {
var _a;
dependencySet.add(node.name.value);
(_a = node.directives) === null || _a === void 0 ? void 0 : _a.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
node.directives?.forEach(directiveNode => visitDirectiveNode(directiveNode, dependencySet));
}

@@ -595,0 +575,0 @@ function visitOperationTypeDefinitionNode(node, dependencySet) {

{
"name": "@graphql-tools/import",
"version": "7.0.0-rc-20230519104353-b09f3180",
"version": "7.0.0-rc-20230519104627-f6fea064",
"description": "A set of utils for faster development of GraphQL tools",

@@ -10,3 +10,3 @@ "sideEffects": false,

"dependencies": {
"@graphql-tools/utils": "10.0.0-rc-20230519104353-b09f3180",
"@graphql-tools/utils": "10.0.0-rc-20230519104627-f6fea064",
"resolve-from": "5.0.0",

@@ -13,0 +13,0 @@ "tslib": "^2.4.0"

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