djbalinD
Convex Community12mo ago
20 replies
djbalin

Circular dependencies in validators

I'm defining my tables using Table from convex helpers, and I want to define some enriched versions of these documents using a Convex validator in the same
schema.ts
file such that I can pass it around to other validators and Convex functions. I'm running into circular dependency issues, however.

See the attached screenshot for the specific example. I can seemingly fix this by putting enrichment validators into a enrich.ts file in each table folder, but is this really the only way? I would love to have both table validator and enriched validators and types in the same
schema.ts
file.
image.png
Was this page helpful?