Documentation
API Reference
Packages
load

@graphql-tools/load

Type Aliases

Variables

Functions

Type Aliases

LoadSchemaOptions

Ƭ LoadSchemaOptions: BuildSchemaOptions & LoadTypedefsOptions & Partial<IExecutableSchemaDefinition> & { includeSources?: boolean }

Defined in

packages/load/src/schema.ts:28


LoadTypedefsOptions

Ƭ LoadTypedefsOptions<ExtraConfig>: BaseLoaderOptions & ExtraConfig & { cache?: { [key: string]: Source[]; } ; filterKinds?: string[] ; loaders: Loader[] ; sort?: boolean }

Type parameters

NameType
ExtraConfig{ [key: string]: any; }

Defined in

packages/load/src/load-typedefs.ts:18


UnnormalizedTypeDefPointer

Ƭ UnnormalizedTypeDefPointer: { [key: string]: any; } | string

Defined in

packages/load/src/load-typedefs.ts:26

Variables

NON_OPERATION_KINDS

Const NON_OPERATION_KINDS: KindList

Kinds of AST nodes that are included in type system definition documents

Defined in

packages/load/src/documents.ts:20


OPERATION_KINDS

Const OPERATION_KINDS: KindList

Kinds of AST nodes that are included in executable documents

Defined in

packages/load/src/documents.ts:15

Functions

filterKind

filterKind(content, filterKinds): undefined | DocumentNode

Parameters

NameType
contentundefined | DocumentNode
filterKindsnull | string[]

Returns

undefined | DocumentNode

Defined in

packages/load/src/filter-document-kind.ts:7


loadDocuments

loadDocuments(pointerOrPointers, options): Promise<Source[]>

Asynchronously loads executable documents (i.e. operations and fragments) from the provided pointers. The pointers may be individual files or a glob pattern. The files themselves may be .graphql files or .js and .ts (in which case they will be parsed using graphql-tag-pluck).

Parameters

NameTypeDescription
pointerOrPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the files to load the documents from
optionsLoadTypedefsOptionsAdditional options

Returns

Promise<Source[]>

Defined in

packages/load/src/documents.ts:32


loadDocumentsSync

loadDocumentsSync(pointerOrPointers, options): Source[]

Synchronously loads executable documents (i.e. operations and fragments) from the provided pointers. The pointers may be individual files or a glob pattern. The files themselves may be .graphql files or .js and .ts (in which case they will be parsed using graphql-tag-pluck).

Parameters

NameTypeDescription
pointerOrPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the files to load the documents from
optionsLoadTypedefsOptionsAdditional options

Returns

Source[]

Defined in

packages/load/src/documents.ts:51


loadSchema

loadSchema(schemaPointers, options): Promise<GraphQLSchema>

Asynchronously loads a schema from the provided pointers.

Parameters

NameTypeDescription
schemaPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the sources to load the schema from
optionsLoadSchemaOptionsAdditional options

Returns

Promise<GraphQLSchema>

Defined in

packages/load/src/schema.ts:44


loadSchemaSync

loadSchemaSync(schemaPointers, options): GraphQLSchema

Synchronously loads a schema from the provided pointers.

Parameters

NameTypeDescription
schemaPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the sources to load the schema from
optionsLoadSchemaOptionsAdditional options

Returns

GraphQLSchema

Defined in

packages/load/src/schema.ts:60


loadTypedefs

loadTypedefs<AdditionalConfig>(pointerOrPointers, options): Promise<Source[]>

Asynchronously loads any GraphQL documents (i.e. executable documents like operations and fragments as well as type system definitions) from the provided pointers. loadTypedefs does not merge the typeDefs when #import is used ( https://github.com/ardatan/graphql-tools/issues/2980#issuecomment-1003692728 )

Type parameters

NameType
AdditionalConfigRecord<string, unknown>

Parameters

NameTypeDescription
pointerOrPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the sources to load the documents from
optionsLoadTypedefsOptions<Partial<AdditionalConfig>>Additional options

Returns

Promise<Source[]>

Defined in

packages/load/src/load-typedefs.ts:36


loadTypedefsSync

loadTypedefsSync<AdditionalConfig>(pointerOrPointers, options): Source[]

Synchronously loads any GraphQL documents (i.e. executable documents like operations and fragments as well as type system definitions) from the provided pointers.

Type parameters

NameType
AdditionalConfigRecord<string, unknown>

Parameters

NameTypeDescription
pointerOrPointersUnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[]Pointers to the sources to load the documents from
optionsLoadTypedefsOptions<Partial<AdditionalConfig>>Additional options

Returns

Source[]

Defined in

packages/load/src/load-typedefs.ts:87