MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / hasRelationFieldsArg

Function hasRelationFieldsArg

packages/cli/src/actions/db.ts:38–41  ·  view source on GitHub ↗
(field: DataField)

Source from the content-addressed store, hash-verified

36};
37
38function hasRelationFieldsArg(field: DataField) {
39 const relationAttr = field.attributes.find((a) => a.decl.ref?.name === '@relation');
40 return !!relationAttr?.args.some((a) => a.name === 'fields');
41}
42
43function getReferencedModelName(field: DataField) {
44 return field.type.reference?.ref ? getDbName(field.type.reference.ref) : undefined;

Callers 1

Calls 1

findMethod · 0.80

Tested by

no test coverage detected