import type * as DMMF from '@prisma/dmmf'
import { getRefAllowedTypeName } from '../utils'
import type { Generable } from './Generable'
export class FieldRefInput implements Generable {
constructor(private type: DMMF.FieldRefType) {}
toTS() {
const allowedTypes = this.getAllowedTypes()
return `
/**
* Reference to a field of type ${allowedTypes}
*/
export type ${this.type.name}<$PrismaModel> = FieldRefInputType<$PrismaModel, ${allowedTypes}>
`
}
private getAllowedTypes() {
return this.type.allowTypes.map(getRefAllowedTypeName).join(' | ')
}
}
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/prisma/prisma'
If you have feedback or need assistance with the MCP directory API, please join our Discord server