We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug
The option cache is part of the interface, but it's typed as cache?: undefined. So it will always throw an error.
cache
cache?: undefined
To Reproduce
const initial = await context.sanity.loadQuery<PageQuery>( PAGE_QUERY, params, { // @ts-expect-error cache: context.storefront.CacheShort(), }, )
loadQuery()
// @ts-expect-error
Expected behavior
cache should be typed properly
Screenshots
Which versions of Sanity are you using?
@sanity/cli (global) 3.28.0 (latest: 3.29.0) @sanity/image-url 1.0.2 (up to date) @sanity/mutator 3.29.0 (up to date) @sanity/react-loader 1.8.3 (up to date) @sanity/types 3.29.0 (up to date) @sanity/visual-editing 1.2.2 (up to date)
What operating system are you using?
Mac Sonoma
Which versions of Node.js / npm are you running?
10.2.3 v20.10.0
The text was updated successfully, but these errors were encountered:
Hi @fcisio, it looks like you're doing something that isn't supported. The cache option is only relevant to next projects. For this to work I believe it would have to be implemented in https://github.com/sanity-io/hydrogen-sanity/
next
Sorry, something went wrong.
Humm I see... Then what is the default cache behavior of loadQuery? Only covering next seems like an oversight.
I think it'll be quite some time until hydrogen-sanity supports the Stega client. Do I have any alternative in the meantime?
hydrogen-sanity
No branches or pull requests
Describe the bug
The option
cache
is part of the interface, but it's typed ascache?: undefined
.So it will always throw an error.
To Reproduce
loadQuery()
// @ts-expect-error
makes the error go awayExpected behavior
cache
should be typed properlyScreenshots
Which versions of Sanity are you using?
@sanity/cli (global) 3.28.0 (latest: 3.29.0)
@sanity/image-url 1.0.2 (up to date)
@sanity/mutator 3.29.0 (up to date)
@sanity/react-loader 1.8.3 (up to date)
@sanity/types 3.29.0 (up to date)
@sanity/visual-editing 1.2.2 (up to date)
What operating system are you using?
Mac Sonoma
Which versions of Node.js / npm are you running?
10.2.3
v20.10.0
The text was updated successfully, but these errors were encountered: