You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/data/query.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -535,6 +535,21 @@ The cache will automatically resolve the relations as soon as the data is availa
535
535
536
536
Plugins hooked on the `fetchRelations` hook will also be called to potentially fetch the data of the relations. See [Plugin hooks](../plugin/hooks.md#fetching-relations) for more details.
537
537
538
+
## Default find options <Badgetext="New in v0.8.3" />
539
+
540
+
You can set default find options for all queries in the store by using the `findDefaults` option when creating the store:
541
+
542
+
```ts
543
+
const store =createStore({
544
+
schema,
545
+
plugins,
546
+
findDefaults: {
547
+
fetchPolicy: 'cache-and-fetch',
548
+
// Other default find options...
549
+
},
550
+
})
551
+
```
552
+
538
553
## Customizing Find Options Types <Badgetext="Changed in v0.7"type="warning" />
539
554
540
555
You can customize the `FindOptions` type used in the `first` and `many` query builder methods and in the `peek*`/`find*` methods by declaring a module augmentation for `@rstore/vue` and extending the `FindOptions` interface.
0 commit comments