import type { BaseContext, ContextFunction } from "@apollo/server"; import type { FastifyReply, FastifyRequest, HTTPMethods, RawServerBase, RawServerDefault, RouteGenericInterface, } from "fastify"; type ValueOrArray = T | T[]; export type ApolloFastifyContextFunctionArgument< RawServer extends RawServerBase = RawServerDefault, RouteGeneric extends RouteGenericInterface = RouteGenericInterface, > = [request: FastifyRequest, reply: FastifyReply]; export type ApolloFastifyContextFunction< Context extends BaseContext, RawServer extends RawServerBase = RawServerDefault, RouteGeneric extends RouteGenericInterface = RouteGenericInterface, > = ContextFunction, Context>; export interface ApolloFastifyHandlerOptions< Context extends BaseContext = BaseContext, RawServer extends RawServerBase = RawServerDefault, RouteGeneric extends RouteGenericInterface = RouteGenericInterface, > { context?: ApolloFastifyContextFunction; } export interface ApolloFastifyPluginOptions< Context extends BaseContext = BaseContext, RawServer extends RawServerBase = RawServerDefault, RouteGeneric extends RouteGenericInterface = RouteGenericInterface, > extends ApolloFastifyHandlerOptions { path?: string; method?: ValueOrArray>; }