UNPKG

@grapi/server

Version:

Grapi Schema Generator For GraphQL Server

28 lines (27 loc) 1.03 kB
import { ObjectTypeDefinitionNode } from 'graphql'; import { SdlField } from '../field/interface'; import { SdlDirective } from '../interface'; import { SdlNamedType } from './interface'; export default class SdlObjectType implements SdlNamedType<ObjectTypeDefinitionNode> { private readonly name; private readonly typeDef; private readonly description; private readonly interfaces; private readonly directives; private readonly fields; constructor({ name, description, interfaces, directives, fields, typeDef, }: { name: string; description?: string; interfaces?: string[]; directives?: Record<string, SdlDirective>; fields?: Record<string, SdlField>; typeDef: ObjectTypeDefinitionNode; }); getName(): string; getField(name: string): SdlField; getFields(): Record<string, SdlField>; getDescription(): string; getInterfaces(): string[]; getDirectives(): Record<string, SdlDirective>; getTypeDef(): ObjectTypeDefinitionNode; }