-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
34 lines (29 loc) · 1.04 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 { FastifyInstance, FastifyRequest } from 'fastify'
import { IResolvers, MercuriusContext } from 'mercurius'
/**
* Mercurius Dynamic schema entry.
*/
export type MercuriusDynamicSchemaEntry<TParent = any, TArgs = any, TContext = MercuriusContext> = {
name: string
path?: string
resolvers: IResolvers
schema: string
}
/**
* Mercurius dynamic schema options.
*/
export interface MercuriusDynamicSchemaOptions<TParent = any, TArgs = any, TContext = MercuriusContext> {
/**
* The dynamic schemas definition for the Mercurius GraphQL server.
*/
schemas: MercuriusDynamicSchemaEntry<TParent, TArgs, TContext>[]
strategy: (arg0: FastifyRequest) => string | string[]
context?: (arg0: FastifyRequest) => any
}
export default MercuriusDynamicSchema
/** Mercurius Dynamic Schema is a plugin for `mercurius` that allows using separate schemas based on request parameters. */
declare function MercuriusDynamicSchema (
instance: FastifyInstance,
opts: MercuriusDynamicSchemaOptions
): Promise<void>;
declare namespace MercuriusDynamicSchema {}