MCPcopy
hub / github.com/prisma/prisma / FieldRefInput

Class FieldRefInput

packages/client-generator-js/src/TSClient/FieldRefInput.ts:6–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import type { Generable } from './Generable'
5
6export class FieldRefInput implements Generable {
7 constructor(private type: DMMF.FieldRefType) {}
8
9 toTS() {
10 const allowedTypes = this.getAllowedTypes()
11 return `
12/**
13 * Reference to a field of type ${allowedTypes}
14 */
15export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${allowedTypes}>
16 `
17 }
18
19 private getAllowedTypes() {
20 return this.type.allowTypes.map(getRefAllowedTypeName).join(' | ')
21 }
22}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…