@terabits/grapi
Version:
Grapi Schema Generator For GraphQL Server
24 lines (23 loc) • 724 B
TypeScript
import { IObjectTypeResolver } from 'graphql-tools';
export interface CreateContext {
data: any;
response: any;
graphqlContext: any;
}
export interface UpdateContext {
where: any;
data: Record<string, any>;
response: any;
graphqlContext: any;
}
export interface DeleteContext {
where: any;
response: any;
graphqlContext: any;
}
export interface Hook {
wrapCreate?: (context: CreateContext, createOperation: () => Promise<any>) => Promise<any>;
wrapUpdate?: (context: UpdateContext, updateOperation: () => Promise<any>) => Promise<any>;
wrapDelete?: (context: DeleteContext, destroyOperation: () => Promise<any>) => Promise<any>;
resolveFields?: IObjectTypeResolver;
}