-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
34 lines (30 loc) · 1.28 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import * as fastify from 'fastify';
import * as WebSocket from 'ws';
import { Server, IncomingMessage, ServerResponse } from 'http';
import { GraphQLSchema, DocumentNode } from 'graphql';
import { IResolvers } from 'graphql-tools';
import { ConnectionContext } from 'subscriptions-transport-ws';
declare namespace fastifyApollo {
interface Options {
path: string,
context?: Record<string, any>,
// schema?: GraphQLSchema,
gqlSchema?: GraphQLSchema,
typeDefs?: DocumentNode | Array<DocumentNode>,
resolvers: IResolvers,
subscriptions?: {
enabled: boolean,
path?: string,
onConnect?: (connectionParams: Object, websocket: WebSocket, context: ConnectionContext) => any,
onDisconnect?: (websocket: WebSocket, context: ConnectionContext) => any,
},
graphiql?: {
enabled: boolean,
path?: string
},
routeBeforeHandler?: (request: IncomingMessage, reply: ServerResponse, done: () => void) => void
// beforeHandler?: (request: IncomingMessage, reply: ServerResponse, done: () => void) => void
}
}
declare const fastifyApollo: fastify.Plugin<Server, IncomingMessage, ServerResponse, fastifyApollo.Options>;
export = fastifyApollo;