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

input-field.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
25
26
27
// @ts-nocheckimport { inputFieldShapeKey } from '../types/index.ts';import FieldRef from './field.ts';export default class InputFieldRef<T = unknown, Kind extends "Arg" | "InputObject" = "Arg" | "InputObject"> { kind: Kind; parentTypename: string; fieldName?: string; argFor?: FieldRef | InputFieldRef; $inferInput!: T; [inputFieldShapeKey]!: T; constructor(kind: Kind, parentTypename: string) { this.kind = kind; this.parentTypename = parentTypename; } toString() { if (this.kind !== "Arg") { if (this.fieldName) { return `${this.parentTypename}.${this.fieldName}`; } return this.parentTypename; } const fieldName = this.argFor?.fieldName ?? "[unnamed field]"; const argName = this.fieldName ?? "[unnamed argument]"; return `${this.parentTypename}.${fieldName}(${argName})`; }}
pothos

Version Info

Tagged at
a year ago