UNPKG

graphql-yoga

Version:

<div align="center"><img src="./website/public/cover.png" width="720" /></div>

8 lines (7 loc) 693 B
import { PromiseOrValue } from '@envelop/core'; import type { GraphQLSchemaWithContext, YogaInitialContext } from '../types.cjs'; import type { Plugin } from './types.cjs'; export type YogaSchemaDefinition<TServerContext, TUserContext> = PromiseOrValue<GraphQLSchemaWithContext<TServerContext & YogaInitialContext & TUserContext>> | ((context: TServerContext & { request: YogaInitialContext['request']; }) => PromiseOrValue<GraphQLSchemaWithContext<TServerContext & YogaInitialContext & TUserContext>>); export declare const useSchema: <TServerContext = {}, TUserContext = {}>(schemaDef?: YogaSchemaDefinition<TServerContext, TUserContext>) => Plugin<YogaInitialContext & TServerContext>;