next-sanity with typed GROQ Results
@[:page_toc](## Page Contents)
npm install next-sanity @sanity-typed/next-sanity
Use createClient
exactly as you would from @sanity-typed/client
.
@typescript @typescript @typescript
@:markdown @:markdown @:markdown @:markdown
The supported Typescript version is now 5.4.2 <= x <= 5.6.3. Older versions are no longer supported and newer versions will be added as we validate it.
Removing the double function signature from createClient
:
- const client = createClient<SanityValues>()({
+ const client = createClient<SanityValues>({
// ...
});
We no longer derive types from your config values. Most of the types weren't significant, but the main loss will be _originalId
when the perspective
was "previewDrafts"
.