@terabits/grapi
Version:
Grapi Schema Generator For GraphQL Server
46 lines (45 loc) • 1.48 kB
TypeScript
import { DataModelType } from './type';
export default class Field {
protected type: DataModelType;
protected nonNull: boolean;
protected list: boolean;
protected nonNullItem: boolean;
protected unique: boolean;
protected readOnly: boolean;
protected autoGen: boolean;
private createdAt;
private updatedAt;
protected metadata: Record<string, any>;
constructor({ type, nonNull, list, nonNullItem, unique, readOnly, autoGen, createdAt, updatedAt, }: {
type: DataModelType;
nonNull?: boolean;
list?: boolean;
nonNullItem?: boolean;
unique?: boolean;
readOnly?: boolean;
autoGen?: boolean;
createdAt?: boolean;
updatedAt?: boolean;
});
isNonNull(): boolean;
setNonNull(value: boolean): void;
isNonNullItem(): boolean;
setNonNullItem(value: boolean): void;
isList(): boolean;
setList(value: boolean): void;
setUnique(value: boolean): void;
isUnique(): boolean;
isReadOnly(): boolean;
setReadOnly(value: boolean): void;
isAutoGenerated(): boolean;
setAutoGen(value: boolean): void;
getType(): DataModelType;
isScalar(): boolean;
getTypename(): string;
getMetadata(key: string): Record<string, any>;
setMetadata(key: string, value: any): Record<string, any>;
isCreatedAt(): boolean;
setCreatedAt(value: boolean): void;
isUpdatedAt(): boolean;
setUpdatedAt(value: boolean): void;
}