Skip to content

Commit

Permalink
docs: add queryOptions documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nkgentile committed Oct 13, 2023
1 parent 3ed6678 commit 9bcd72f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,24 @@ export const loader: LoaderFunction = async function ({request, context}) {
}
```
## Request Options
If you need to pass any additional options to the request, provide `queryOptions` like so:
```ts
const page = await context.sanity.query<HomePage>({
query: HOME_PAGE_QUERY,
cache,
// These additional options will be passed to `fetch`
queryOptions: {
tag: 'home',
headers: {
'Accept-Encoding': 'br, gzip, *',
},
},
})
```
## Limits
The real-time preview comes with a configured limit of 3000 documents. You can experiment with larger datasets by configuring `cache.maxDocuments: <Integer>` in your `PreviewProvider`. Be aware that this might affect the preview performance.
Expand Down

0 comments on commit 9bcd72f

Please sign in to comment.