Replies: 1 comment
|
+1, with a second use case and numbers. We build portfolio sites for video production companies on EmDash 1.1.0. A SEO has the same gap. What would let us delete our workaround is item 1 of the proposal: cc @ascorbic Measured with Claude (Opus 5.5) on local |
Uh oh!
There was an error while loading. Please reload this page.
The problem
Since 1.0,
referencefields are bound to relations (migration 087) and the links live in_emdash_content_references. That's a good model, but two paths can't reach it yet, and both are the ones a site or an agent uses most:1. Listings can't include references.
getEmDashEntry(collection, slug, { references: { region: true } })works, butgetEmDashCollection()has noreferencesoption. And the old column isn't a fallback: after migration it's never written again, so it's empty on new entries and stale on edited ones. Any page that lists entries grouped or filtered by a reference (a region index, "posts by this author", related items) has no supported way to get the value in bulk.What we do today: one raw query through
getDb()joining_emdash_content_referencesto_emdash_relationsfor our three relation slugs, mapped back byparent_group, overriding the stale column. It works on SQLite and D1, but it reads internal tables that could change in any release.2. The MCP tools can't set a relation.
content_create/content_updateacceptdata, and a reference field insidedatais refused; there's noreferencesargument. So an agent that writes a post through MCP (our owner writes posts that way from Claude and ChatGPT) can fill every field except the ones that are relations, and a person has to finish each post in the admin.This overlaps with #410 (eager-loading references in listings), which predates relations; the 1.0 relation model makes the listing half more pressing because the column no longer holds the value.
Proposal
getEmDashCollection(collection, { references: { field: true } }), same selection shape and result (entry.references.<field>) asgetEmDashEntry, batched in one query per selected field rather than per row.content_create/content_update: areferences: { <field>: [id, …] }argument with the same semantics as the REST API'sreferenceson a write, validated against the relation's limits (e.g.maxChildrenPerParent), plus the relation targets inschema_get_collectionso an agent knows what to look up.Glad to help with either, starting with whichever you prefer.
Drafted with Claude (Opus 5.5) from our site's code; checked against
mainat 584f166.All reactions