@pothos/core
Version:
Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript
29 lines (22 loc) • 600 B
text/typescript
import {
type InputRef,
inputShapeKey,
type OutputRef,
outputShapeKey,
type PothosEnumTypeConfig,
type SchemaTypes,
} from '../types';
import { BaseTypeRef } from './base';
export class EnumRef<Types extends SchemaTypes, T, U = T>
extends BaseTypeRef<Types, PothosEnumTypeConfig>
implements OutputRef<T>, InputRef<U>, PothosSchemaTypes.EnumRef<Types, T, U>
{
override kind = 'Enum' as const;
$inferType!: T;
$inferInput!: U;
[outputShapeKey]!: T;
[inputShapeKey]!: U;
constructor(name: string, config?: PothosEnumTypeConfig) {
super('Enum', name, config);
}
}