1 | import { GraphQLResolveInfo } from 'graphql';
|
2 | export interface MiddlewareContext<TSource = any, TContext = any, TArgs = {
|
3 | [argName: string]: any;
|
4 | }> {
|
5 | source: TSource;
|
6 | args: TArgs;
|
7 | context: TContext;
|
8 | info: GraphQLResolveInfo;
|
9 | }
|
10 | export type NextFn<T = any> = () => Promise<T>;
|
11 | export interface FieldMiddleware<TSource = any, TContext = any, TArgs = {
|
12 | [argName: string]: any;
|
13 | }, TOutput = any> {
|
14 | (ctx: MiddlewareContext<TSource, TContext, TArgs>, next: NextFn): Promise<TOutput> | TOutput;
|
15 | }
|
16 |
|
\ | No newline at end of file |