import type { SchemaTypes } from '@pothos/core'; import { PrismaObjectRef } from './object-ref.js'; import type { ModelKey, ObjectBaseShape } from './types/models.js'; export const prismaRelayIDShapeBrand = Symbol.for('Pothos.prismaRelayIDShapeBrand'); export class PrismaNodeRef< Types extends SchemaTypes, M extends ModelKey, Shape = ObjectBaseShape, IDShape = string, > extends PrismaObjectRef { declare readonly [prismaRelayIDShapeBrand]: IDShape; readonly parseId?: (id: string, ctx: object) => IDShape; constructor( name: string, modelKey: M, options: { parseId?: (id: string, ctx: object) => IDShape } = {}, ) { super(name, modelKey); if (options.parseId) { this.parseId = options.parseId; } } }