UNPKG

@pothos/core

Version:

Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript

32 lines (24 loc) 663 B
import { type InputRef, inputShapeKey, type OutputRef, outputShapeKey, type PothosScalarTypeConfig, parentShapeKey, type SchemaTypes, } from '../types'; import { BaseTypeRef } from './base'; export class ScalarRef<Types extends SchemaTypes, T, U, P = T> extends BaseTypeRef<Types, PothosScalarTypeConfig> implements OutputRef<T>, InputRef<U>, PothosSchemaTypes.ScalarRef<Types, T, U, P> { override kind = 'Scalar' as const; $inferType!: T; $inferInput!: U; [outputShapeKey]!: T; [parentShapeKey]!: P; [inputShapeKey]!: U; constructor(name: string, config?: PothosScalarTypeConfig) { super('Scalar', name, config); } }