@terabits/grapi
Version:
Grapi Schema Generator For GraphQL Server
25 lines (24 loc) • 814 B
TypeScript
import { IObjectTypeResolver } from 'graphql-tools';
import { ListMutable } from '..';
import Model from '../dataModel/model';
import { Hook } from '../hooks/interface';
import { Context, Plugin } from './interface';
export default class CreatePlugin implements Plugin {
private whereInputPlugin;
private baseTypePlugin;
private readonly hook;
constructor({ hook, }: {
hook: Hook;
});
setPlugins(plugins: Plugin[]): void;
visitModel(model: Model, context: Context): void;
resolveInMutation({ model, dataSource }: {
model: Model;
dataSource: ListMutable;
}): IObjectTypeResolver;
getCreateInputName(model: Model): string;
private generateCreateInput;
private static getMutationName;
private createMutation;
private setDateDirective;
}