/* eslint-disable max-classes-per-file */ import { OutputRef, outputShapeKey } from '../types'; import BaseTypeRef from './base'; import { InterfaceParam, ObjectTypeOptions, parentShapeKey, SchemaTypes } from '..'; export default class ObjectRef extends BaseTypeRef implements OutputRef, GiraphQLSchemaTypes.ObjectRef { override kind = 'Object' as const; [outputShapeKey]: T; [parentShapeKey]: P; constructor(name: string) { super('Object', name); } } export class ImplementableObjectRef< Types extends SchemaTypes, Shape, Parent = Shape, > extends ObjectRef { private builder: GiraphQLSchemaTypes.SchemaBuilder; constructor(builder: GiraphQLSchemaTypes.SchemaBuilder, name: string) { super(name); this.builder = builder; } implement[]>( options: ObjectTypeOptions< Types, ImplementableObjectRef, Parent, Interfaces >, ) { return this.builder.objectType(this, options); } }