ErrorsReads and writes · rule
query.result_rule
Query result type has rules across its fields.
Area 6, Reads and writes; not declinable; the next step is usually the agent's.
type LeafCount = Int { min: 1 max: 5000}entity Book { id: Uuid leaves: LeafCount}type ThickBook = Output { pick: [Book.id, Book.leaves] rule thick: leaves > 1000}query thick_books() -> List<ThickBook> { from: Book order: [Book.id asc] limit: 20}
error thick_books returns ThickBook, whose rule thick no read can check
--> main.jadpo:16:24
|16 | query thick_books() -> List<ThickBook> { | ^^^^^^^^^^^^^^^ `ThickBook` has rules
- reason
- A rule across an object's fields is checked whenever a value is made, and a value that breaks it is a failure an
attemptmaps; a query makesThickBookfrom stored records with noattemptaround it, so its result type has no rules across its fields. - next
- Return a type without rules, and build
ThickBookfrom it withattemptwhere its rules are checked (agent) - rule
- query.
result_ rule - help
- https://jadpo.
dev/docs/errors/query. result_ rule
A query that needs only the thick books says so in where:, and a type
with the rule is built from its result where a failure can be mapped.
Markdown for agents: /docs/errors/query.result_rule.md.Built from Jadpo main at aee2e8f.