UNPKG

@graphql-yoga/nestjs-federation

Version:

GraphQL Yoga driver with Apollo Federation for NestJS GraphQL.

28 lines (27 loc) 1.81 kB
import { GraphQLSchema } from "graphql"; import { GatewayConfig } from "@apollo/gateway"; import { AbstractYogaDriver, YogaDriver, YogaDriverConfig, YogaDriverPlatform } from "@graphql-yoga/nestjs"; import { Type } from "@nestjs/common"; import { GraphQLFederationFactory } from "@nestjs/graphql"; //#region src/index.d.ts type YogaFederationDriverConfig<Platform extends YogaDriverPlatform = 'express'> = YogaDriverConfig<Platform>; declare class YogaFederationDriver<Platform extends YogaDriverPlatform = 'express'> extends AbstractYogaDriver<Platform> { private readonly graphqlFederationFactory; private subscriptionService?; constructor(graphqlFederationFactory: GraphQLFederationFactory); generateSchema(options: YogaFederationDriverConfig<Platform>): Promise<GraphQLSchema>; start(options: YogaFederationDriverConfig<Platform>): Promise<void>; stop(): Promise<void>; } interface YogaGatewayDriverConfig<Platform extends YogaDriverPlatform = 'express'> { driver?: Type<YogaDriver<Platform>>; gateway?: GatewayConfig; server?: Omit<YogaDriverConfig<Platform>, 'endpoint' | 'schema' | 'typeDefs' | 'definitions' | 'resolvers' | 'resolverValidationOptions' | 'directiveResolvers' | 'autoSchemaFile' | 'transformSchema' | 'subscriptions' | 'buildSchemaOptions' | 'fieldResolverEnhancers' | 'driver'>; } declare class YogaGatewayDriver<Platform extends YogaDriverPlatform = 'express'> extends AbstractYogaDriver<Platform> { generateSchema(_options: YogaGatewayDriverConfig<Platform>): Promise<GraphQLSchema>; start(options: YogaGatewayDriverConfig<Platform>): Promise<void>; mergeDefaultOptions(options: Record<string, unknown>): Promise<Record<string, unknown>>; } //#endregion export { YogaFederationDriver, YogaFederationDriverConfig, YogaGatewayDriver, YogaGatewayDriverConfig };