# Typed queries, preference hooks, and dashboard pagination

**Version:** v3.13.0

**Published:** November 16, 2026

SDK 3.13.0 adds typed GROQ query results, beta hooks for user preferences, and pagination support for dashboard hooks. It also fixes several reliability issues with authentication, cached reads, and pending changes.

## Typed GROQ queries

`useQuery`, `getQueryState`, and `resolveQuery` now infer result and parameter types from queries imported through [@sanity-labs/groq-content-mapper](https://github.com/sanity-labs/groq-content-mapper). This feature is experimental. It needs TypeScript 7.1 or later, type-checking with `tsc --noEmit --runExternalCode`, and a `schema.json` from `npx sanity schema extract`. Setup also needs a `contentMappers` entry in your tsconfig and the `@sanity-labs/groq-content-mapper/vite` plugin in `sanity.cli.ts`.

## User preference hooks (beta)

New hooks let apps read and update per-user, per-project, and shared preferences. Keys come from a fixed set that Sanity owns (`context.*`, `dashboard.*`, `manage.*`, and `studio.*`), so apps can't define their own keys.

- [useUserPreference](https://reference.sanity.io/_sanity/sdk-react/exports/useUserPreference/) reads a single preference.
- [useUpdateUserPreference](https://reference.sanity.io/_sanity/sdk-react/exports/useUpdateUserPreference/) updates a preference, with optimistic updates and automatic rollback if the API rejects the change.
- [useUserPreferenceList](https://reference.sanity.io/_sanity/sdk-react/exports/useUserPreferenceList/) and [useUpdateUserPreferenceList](https://reference.sanity.io/_sanity/sdk-react/exports/useUpdateUserPreferenceList/) manage paginated preference lists, with a `loadMore` function for fetching additional pages.

Preferences can be scoped to a project, an organization, or a user. With `shared: true`, a hook reads or changes the value that everyone in the project or organization shares, for keys that have a shared value. `resourceType` picks the project or organization. Each preference also reports `isDefault` and `canEdit` flags.

Requests for a project's preferences go to the project's API host (`<projectId>.api.sanity.io`). Set `useProjectHostname: false` to use the global API host instead. Organization and user preferences use the global host.

## Paginated dashboard hooks

`useApplications` and `useInstallations` now support pagination through a `loadMore` function and a `hasMore` flag. `useUsers` already had these, and now also returns an `error` field, so a failed `loadMore` keeps the users already shown. The older `cursor` option on `useApplications` and `useInstallations`, and the `userId` option on `useUsers`, are deprecated, along with `getUsersState`, `resolveUsers`, and `loadMoreUsers`. Those three functions will be removed in the next major release.

## Dashboard panel and tile hooks

New and updated hooks in `@sanity/sdk-react/dashboard` work with dashboard panels, tiles, and applications.

- [useApplication](https://reference.sanity.io/_sanity/sdk-react/dashboard/useApplication/) now finds an application by its slug as well as its ID.
- [usePanel](https://reference.sanity.io/_sanity/sdk-react/dashboard/usePanel/) and [useView](https://reference.sanity.io/_sanity/sdk-react/dashboard/useView/) return the current panel or view, and `usePanel` also returns an `onClose` function.
- [useTile](https://reference.sanity.io/_sanity/sdk-react/dashboard/useTile/) and [useAssetSource](https://reference.sanity.io/_sanity/sdk-react/dashboard/useAssetSource/) return the current tile or asset source view.
- [useApplicationId](https://reference.sanity.io/_sanity/sdk-react/dashboard/useApplicationId/) returns the current application's ID.

## 🐛 Notable bugfixes and improvements

- `useCurrentUser` no longer briefly returns `null` after an OAuth token refresh.
- Pending preference and favorite changes stay visible while other changes are resolving, fixing favorites that appeared to disappear when starred in quick succession.
- Preference reads made together are now batched into a single request per project, organization, or user, up to 100 keys at a time.
- Changes to preference lists, applications, and document favorites are now sent in the order you made them.
- Cached reads that failed with a 401 error retry automatically once a new token is available. Reads that fail with a network error or a 5xx response retry with backoff.
- A cached read that previously failed now sends a fresh request instead of returning the old error.
- Read failures that aren't network-related now show immediately instead of retrying indefinitely.

