Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions content/docs/ui/react-pages.mdx
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,7 +144,7 @@ function Page() {
$filter: ['status', '!=', 'paid'],
$top: 200,
});
const records = Array.isArray(result) ? result : (result && result.records) || [];
const records = result?.data ?? result?.records ?? (Array.isArray(result) ? result : []);
if (alive) setRows(records);
})();
return () => { alive = false; };
Expand All@@ -156,8 +156,10 @@ function Page() {

<Callout type="warn">
The `$` prefixes are load-bearing. An unprefixed `top:` or a `filters:` key is not a
query option — it is silently dropped, and the query comes back unfiltered or with the
default page size. There is no error.
query option — it is silently dropped, and the query runs as if you had not written
it: a dropped `filters:` comes back unfiltered, and a dropped `top:` comes back with
**every matching row**, because the list route has no default page size. The failure
mode is an unbounded read, not a truncated one. There is no error.
</Callout>

`$filter` takes an ObjectQL filter array: `['field', 'op', value]`, with `and` / `or`
Expand Down
Loading