Skip to content

Conversation

judofyr
Copy link
Contributor

@judofyr judofyr commented Sep 24, 2025

Description

This contains a non-breaking change to useQuery (and other hooks which uses this under the hood) of accepting a source parameter. This can be used to query datasets which are not part of the current context.

However, this has lead to some breaking changes to the core package:

  • The QueryOptions no longer takes an optional projectId/dataset, but rather a required source. This will always represent the resource we'll be querying.
  • The same applies to perspective. This is part of the work of decoupling the perspective setting from the SanityInstace.
  • However, since we still want useQuery to have the same options we've now introduced a new UseQueryOptions. This could potentially be considered a breaking change.

What to review

Testing

Fun gif

Copy link

vercel bot commented Sep 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sdk-docs Ready Ready Preview Comment Sep 26, 2025 8:42am
sdk-kitchensink-react Ready Ready Preview Comment Sep 26, 2025 8:42am

This contains a non-breaking change to `useQuery` (and other hooks which
uses this under the hood) of accepting a `source` parameter. This can be
used to query datasets which are not part of the current context.

However, this has lead to some breaking changes to the `core` package:

- The QueryOptions no longer takes an _optional_ projectId/dataset, but
  rather a _required_ `source`. This will always represent the resource
  we'll be querying.
- The same applies to `perspective`. This is part of the work of
  decoupling the perspective setting from the SanityInstace.
- However, since we still want `useQuery` to have the same options we've
  now introduced a new UseQueryOptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant