UNPKG

moleculer-api

Version:

A dynamic API Gateway for MoleculerJS which updates REST endpoints and aggregated GraphQL schema, access control policy for each action calls from metadata of remote services schema without restart or deployment.

17 lines (16 loc) 1.03 kB
import { GraphQLOptions } from "apollo-server-core"; import { SubscriptionServerOptions } from "apollo-server-core/src/types"; import { ApolloServer, Config as ApolloServerConfig } from "apollo-server-express"; import { APIRequestContext, HTTPRouteHandler, WebSocketRouteHandler } from "../../../../../server"; export declare type GraphQLHandlersOptions = Omit<ApolloServerConfig, "subscriptions" | "playground" | "schema" | "context"> & { subscriptions?: Omit<SubscriptionServerOptions, "path" | "onConnect" | "onDisconnect"> | false; playground?: boolean; }; export declare class GraphQLHandlers extends ApolloServer { constructor(onMessage: (message: string | Error) => void, opts: GraphQLHandlersOptions); createGraphQLServerOptionsWithContext(context: APIRequestContext, req: any, res: any): Promise<GraphQLOptions>; readonly handler: HTTPRouteHandler; readonly subscriptionHandler?: WebSocketRouteHandler; readonly playgroundHandler?: HTTPRouteHandler; private waitForPromisedVariables; }