deno.land / x / pothos@release-1713397530 / packages / core / refs / input-object.ts

input-object.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// @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>; }}
pothos

Version Info

Tagged at
a year ago