UNPKG

@cran/gql.koa

Version:

Cran/GraphQL Koa Server

18 lines (17 loc) 892 B
import type { GraphQLSchema } from "graphql"; import type Koa from "koa"; import type { Config as ApolloConfig, GraphQLOptions } from "apollo-server-core"; import { ApolloServer } from "./ApolloServer"; export declare namespace DynamicApolloServer { type SchemaFactoryParameters = Parameters<ApolloServer["createGraphQLServerOptions"]>; type SchemaFactory = (...args: SchemaFactoryParameters) => Promise<GraphQLSchema> | GraphQLSchema; interface Config extends ApolloConfig<Koa.Context> { schemaFactory?: DynamicApolloServer["schemaFactory"]; } } export declare class DynamicApolloServer extends ApolloServer { private readonly schemaFactory?; private readonly derivedData; constructor({ schemaFactory, ...rest }: DynamicApolloServer.Config); createGraphQLServerOptions(...args: DynamicApolloServer.SchemaFactoryParameters): Promise<GraphQLOptions>; }