Skip to main content

@graphql-tools/load

Variables#

Functions#

Type aliases#

LoadSchemaOptions#

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

Defined in: packages/load/src/schema.ts:7


LoadTypedefsOptions#

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

Type parameters#

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

Defined in: packages/load/src/load-typedefs.ts:10


UnnormalizedTypeDefPointer#

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

Defined in: packages/load/src/load-typedefs.ts:19

Variables#

NON_OPERATION_KINDS#

Const NON_OPERATION_KINDS: any[]

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

Defined in: packages/load/src/documents.ts:13


OPERATION_KINDS#

Const OPERATION_KINDS: ("OperationDefinition" | "FragmentDefinition")[]

Kinds of AST nodes that are included in executable documents

Defined in: packages/load/src/documents.ts:8

Functions#

filterKind#

Const filterKind(content: DocumentNode, filterKinds: string[]): DocumentNode

internal

Parameters#

NameType
contentDocumentNode
filterKindsstring[]

Returns: DocumentNode

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


loadDocuments#

loadDocuments(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions): 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:25


loadDocumentsSync#

loadDocumentsSync(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions): 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:40


loadSchema#

loadSchema(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): 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:23


loadSchemaSync#

loadSchemaSync(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): 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:53


loadTypedefs#

loadTypedefs<AdditionalConfig\>(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions<Partial<AdditionalConfig\>\>): 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.

Type parameters#

NameDefault
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:28


loadTypedefsSync#

loadTypedefsSync<AdditionalConfig\>(pointerOrPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadTypedefsOptions<Partial<AdditionalConfig\>\>): 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#

NameDefault
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:73