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
When using the useSanityQuery the query fails to update the data state when a reactive parameter passed to it changes. This issue occurs both when the refresh function is called directly and when a reactive dependency is modified.
Using the more explicit useAsyncData composable with a manual watch on the reactive parameter correctly triggers a refetch and updates the data.
Version
module: 1.13.3
nuxt: 3.17.5
Reproduction
This issue exists which refresh is called directly and when a reactive parameter changes
`
// this makes a network request to sanity but does not update the data state
const { data } = useSanityQuery(articleByDateQuery, { date: dateRef })
// this works and correctly updates data
const { data } = useAsyncData('articles', () => sanity.fetch(articleByDateQuery, { date: dateRef.value }), {watch: [dateRef]})
`