@graphql-tools/import
Interfaces
Type Aliases
Functions
Type Aliases
VisitedFilesMap
Ƭ VisitedFilesMap: Map<string, Map<string, Set<DefinitionNode>>>
Defined in
packages/import/src/index.ts:63
Functions
extractDependencies
▸ extractDependencies(filePath, fileContents): Object
Parameters
| Name | Type |
|---|---|
filePath | string |
fileContents | string |
Returns
Object
| Name | Type |
|---|---|
definitionsByName | Map<string, Set<DefinitionNode>> |
dependenciesByDefinitionName | DependenciesByDefinitionName |
Defined in
packages/import/src/index.ts:347
extractImportLines
▸ extractImportLines(fileContent): Object
Splits the contents of a GraphQL file into lines that are imports and other lines which define the actual GraphQL document.
Parameters
| Name | Type |
|---|---|
fileContent | string |
Returns
Object
| Name | Type |
|---|---|
importLines | string[] |
otherLines | string |
Defined in
packages/import/src/index.ts:658
parseImportLine
▸ parseImportLine(importLine): Object
Parses an import line, returning a list of entities imported and the file from which they are imported.
Throws if the import line does not have a correct format.
Parameters
| Name | Type |
|---|---|
importLine | string |
Returns
Object
| Name | Type |
|---|---|
from | string |
imports | string[] |
Defined in
packages/import/src/index.ts:681
processImport
▸ processImport(filePath, cwd?, predefinedImports?, visitedFiles?, pathAliases?): DocumentNode
Loads the GraphQL document and recursively resolves all the imports and copies them into the final document. processImport does not merge the typeDefs as designed ( https://github.com/ardatan/graphql-tools/issues/2980#issuecomment-1003692728 )
Parameters
| Name | Type |
|---|---|
filePath | string |
cwd | string |
predefinedImports | Record<string, string> |
visitedFiles | VisitedFilesMap |
pathAliases? | PathAliases |
Returns
DocumentNode
Defined in
packages/import/src/index.ts:135
processImports
▸ processImports(importLines, filePath, visitedFiles, predefinedImports, pathAliases?): Object
Parameters
| Name | Type |
|---|---|
importLines | string[] |
filePath | string |
visitedFiles | VisitedFilesMap |
predefinedImports | Record<string, string> |
pathAliases? | PathAliases |
Returns
Object
| Name | Type |
|---|---|
allImportedDefinitionsMap | Map<string, Set<DefinitionNode>> |
potentialTransitiveDefinitionsMap | Map<string, Set<DefinitionNode>> |