deno.land / x / pothos@release-1713397530 / packages / core / refs / input-object.ts
123456789101112131415161718192021222324// @ts-nocheck/* eslint-disable max-classes-per-file */import { InputFieldsFromShape, InputRef, inputShapeKey, SchemaTypes } from '../types/index.ts';import BaseTypeRef from './base.ts';export default class InputObjectRef<T> extends BaseTypeRef implements InputRef<T>, PothosSchemaTypes.InputObjectRef<T> { override kind = "InputObject" as const; $inferInput!: T; [inputShapeKey]!: T; constructor(name: string) { super("InputObject", name); }}export class ImplementableInputObjectRef<Types extends SchemaTypes, T extends object, Resolved = T> extends InputObjectRef<Resolved> { protected builder: PothosSchemaTypes.SchemaBuilder<Types>; constructor(builder: PothosSchemaTypes.SchemaBuilder<Types>, name: string) { super(name); this.builder = builder; } implement(options: PothosSchemaTypes.InputObjectTypeOptions<Types, InputFieldsFromShape<T>>) { this.builder.inputType<ImplementableInputObjectRef<Types, T>, InputFieldsFromShape<T>>(this as never, options); return this as InputObjectRef<Resolved>; }}
Version Info