Skip to content

Commit 605d21b

Browse files
committed
docs: Docs updates
1 parent 6dc8d84 commit 605d21b

7 files changed

Lines changed: 28 additions & 4 deletions

File tree

docs/core/api/useQuery.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import VoteDemo from '../shared/\_VoteDemo.mdx';
1616
Data rendering without the fetch.
1717

1818
Access any [Queryable Schema](/rest/api/schema#queryable)'s store value; like [Entity](/rest/api/Entity), [All](/rest/api/All), [Collection](/rest/api/Collection), [Query](/rest/api/Query),
19-
and [Union](/rest/api/Union). If the value does not exist, returns `undefined`.
19+
and [Union](/rest/api/Union). [Lazy](/rest/api/Lazy) fields also work via their [`.query`](/rest/api/Lazy#query) accessor.
20+
If the value does not exist, returns `undefined`.
2021

2122
`useQuery()` is reactive to data [mutations](../getting-started/mutations.md); rerendering only when necessary. Returns `undefined`
2223
when data is [Invalid](../concepts/expiry-policy#invalid).
@@ -59,7 +60,7 @@ function useQuery<S extends Queryable>(
5960

6061
[Queryable](/rest/api/schema#queryable) schemas require an `queryKey()` method that returns something. These include
6162
[Entity](/rest/api/Entity), [All](/rest/api/All), [Collection](/rest/api/Collection), [Query](/rest/api/Query),
62-
and [Union](/rest/api/Union).
63+
and [Union](/rest/api/Union). [Lazy](/rest/api/Lazy) fields produce a Queryable via their [`.query`](/rest/api/Lazy#query) accessor.
6364

6465
```ts
6566
interface Queryable {

docs/core/shared/_schema_table.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,16 @@
6666
<td align="center">🛑</td>
6767
</tr>
6868
<tr>
69-
<td>any</td>
69+
<td rowSpan={2}>any</td>
7070
<td align="center"></td>
7171
<td>[Query(Queryable)](/rest/api/Query)</td>
7272
<td>memoized custom transforms</td>
7373
<td align="center">✅</td>
7474
</tr>
75+
<tr>
76+
<td align="center"></td>
77+
<td>[Lazy(Schema)](/rest/api/Lazy)</td>
78+
<td>deferred denormalization</td>
79+
<td align="center">🛑</td>
80+
</tr>
7581
</tbody></table>

docs/rest/api/Entity.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ class Department extends Entity {
451451
Set this on entities that participate in deep or wide bidirectional relationships.
452452
Normal entity graphs (depth < 10) never approach the default limit.
453453

454+
For relationships that don't need eager denormalization, [Lazy](/rest/api/Lazy)
455+
skips resolution entirely and lets you resolve on demand via [useQuery](/docs/api/useQuery).
456+
454457
:::
455458

456459
## Lifecycle

docs/rest/api/Query.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ the same high performance and referential equality guarantees expected of Reacti
2525
[Schema](./schema.md) used to retrieve/denormalize data from the Reactive Data Client cache.
2626
This accepts any [Queryable](/rest/api/schema#queryable) schema: [Entity](./Entity.md), [All](./All.md), [Collection](./Collection.md), [Query](./Query.md),
2727
[Union](./Union.md), and [Object](./Object.md) schemas for joining multiple entities.
28+
[Lazy](./Lazy.md) fields produce a Queryable via their [`.query`](./Lazy.md#query) accessor.
2829

2930
### process(entries, ...args) {#process}
3031

docs/rest/api/schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ This enables their use in these additional cases:
244244
- Improve performance of [useSuspense](/docs/api/useSuspense), [useDLE](/docs/api/useDLE) by rendering before endpoint resolution
245245

246246
`Querables` include [Entity](./Entity.md), [All](./All.md), [Collection](./Collection.md), [Query](./Query.md),
247-
and [Union](./Union.md).
247+
and [Union](./Union.md). [Lazy](./Lazy.md) fields produce a Queryable via their [`.query`](./Lazy.md#query) accessor.
248248

249249
```ts
250250
interface Queryable {

docs/rest/guides/relational-data.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,15 @@ export class User extends Entity {
600600
}
601601
```
602602

603+
:::tip
604+
605+
For bidirectional relationships that don't need eager denormalization,
606+
[Lazy](../api/Lazy.md) defers resolution and lets you resolve on demand
607+
via [useQuery](/docs/api/useQuery), avoiding deep recursion and improving
608+
memoization isolation.
609+
610+
:::
611+
603612
[1]: ../api/Entity.md
604613
[2]: /docs/api/useCache
605614
[3]: ../api/Entity.md#schema

website/sidebars-endpoint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
"type": "doc",
4848
"id": "api/Invalidate"
4949
},
50+
{
51+
"type": "doc",
52+
"id": "api/Lazy"
53+
},
5054
{
5155
"type": "doc",
5256
"id": "api/validateRequired"

0 commit comments

Comments
 (0)