@graphql-tools/load
Classes
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
| Name | Type |
|---|---|
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
| Name | Type |
|---|---|
content | undefined | DocumentNode |
filterKinds | null | 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
| Name | Type | Description |
|---|---|---|
pointerOrPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the files to load the documents from |
options | LoadTypedefsOptions | Additional 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
| Name | Type | Description |
|---|---|---|
pointerOrPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the files to load the documents from |
options | LoadTypedefsOptions | Additional 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
| Name | Type | Description |
|---|---|---|
schemaPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the sources to load the schema from |
options | LoadSchemaOptions | Additional 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
| Name | Type | Description |
|---|---|---|
schemaPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the sources to load the schema from |
options | LoadSchemaOptions | Additional 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
| Name | Type |
|---|---|
AdditionalConfig | Record<string, unknown> |
Parameters
| Name | Type | Description |
|---|---|---|
pointerOrPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the sources to load the documents from |
options | LoadTypedefsOptions<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
| Name | Type |
|---|---|
AdditionalConfig | Record<string, unknown> |
Parameters
| Name | Type | Description |
|---|---|---|
pointerOrPointers | UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[] | Pointers to the sources to load the documents from |
options | LoadTypedefsOptions<Partial<AdditionalConfig>> | Additional options |
Returns
Source[]