@pothos/core
Version:
Pothos (formerly GiraphQL) is a plugin based schema builder for creating code-first GraphQL schemas in typescript
26 lines (18 loc) • 608 B
text/typescript
import { outputShapeKey, parentShapeKey, type SchemaTypes, type TypeParam } from '../types';
import { BaseTypeRef } from './base';
export class ListRef<Types extends SchemaTypes, T, P = T>
extends BaseTypeRef<Types>
implements PothosSchemaTypes.ListRef<Types, T, P>
{
override kind = 'List' as const;
$inferType!: T;
[outputShapeKey]!: T;
[parentShapeKey]!: P;
listType: TypeParam<Types>;
nullable: boolean;
constructor(listType: TypeParam<Types>, nullable: boolean) {
super('List', `List<${String(listType)}>`);
this.listType = listType;
this.nullable = nullable;
}
}