UNPKG

@grapi/server

Version:

Grapi Schema Generator For GraphQL Server

24 lines (23 loc) 731 B
import { IObjectTypeResolver } from '@graphql-tools/utils'; 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; }