@graphql-tools/load
Version:
A set of utils for faster development of GraphQL tools
24 lines (23 loc) • 1.15 kB
TypeScript
import { BuildSchemaOptions, GraphQLSchema } from 'graphql';
import { IExecutableSchemaDefinition } from '@graphql-tools/schema';
import { LoadTypedefsOptions, UnnormalizedTypeDefPointer } from './load-typedefs.js';
export type LoadSchemaOptions = BuildSchemaOptions & LoadTypedefsOptions & Partial<IExecutableSchemaDefinition> & {
/**
* Adds a list of Sources in to `extensions.sources`
*
* Disabled by default.
*/
includeSources?: boolean;
};
/**
* Asynchronously loads a schema from the provided pointers.
* @param schemaPointers Pointers to the sources to load the schema from
* @param options Additional options
*/
export declare function loadSchema(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): Promise<GraphQLSchema>;
/**
* Synchronously loads a schema from the provided pointers.
* @param schemaPointers Pointers to the sources to load the schema from
* @param options Additional options
*/
export declare function loadSchemaSync(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): GraphQLSchema;