apollo-server-restify
Version:
Production-ready Node.js GraphQL server for Restify
15 lines (14 loc) • 838 B
TypeScript
import * as restify from 'restify';
import { GraphQLOptions } from 'apollo-server-core';
import * as GraphiQL from 'apollo-server-module-graphiql';
export interface RestifyGraphQLOptionsFunction {
(req?: restify.Request, res?: restify.Response): GraphQLOptions | Promise<GraphQLOptions>;
}
export interface RestifyHandler {
(req: restify.Request, res: restify.Response, next: restify.Next): void;
}
export declare function graphqlRestify(options: GraphQLOptions | RestifyGraphQLOptionsFunction): RestifyHandler;
export interface RestifyGraphiQLOptionsFunction {
(req?: restify.Request): GraphiQL.GraphiQLData | Promise<GraphiQL.GraphiQLData>;
}
export declare function graphiqlRestify(options: GraphiQL.GraphiQLData | RestifyGraphiQLOptionsFunction): (req: restify.Request, res: restify.Response, next: restify.Next) => void;