Skip to content
New issue

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

Add configuration property to set the Sanity client API version #12

Open
brandonburrus opened this issue Dec 31, 2021 · 1 comment
Open

Comments

@brandonburrus
Copy link

Description:

Currently the extension configures a client that uses the default version v1. While this works for most GROQ queries, newer features added in later versions after the versioning schema changed to MM-DD-YYYY don't work because of this. For example, trying to use the pt::text() function causes the query to fail due to the configured client using v1, and not v2021-03-25 or later when the function was introduced to the API.

Proposed Solution:

Add a configuration property to the extension (something like "sanity.apiVersion") that allows users to configure the version.

@msafi
Copy link

msafi commented Jun 21, 2022

Theoretically, if you add apiVersion to the api key in sanity.json, it should be picked up by the extension. However, the @sanity/client package used in this extension is version 2, which doesn't seem to support apiVersion. So before you can add apiVersion to sanity.json, the package would need to be updated to version 3.

Personally, I went into .vscode/extensions/sanity-io.vscode-sanity-0.1.4 and upgraded @sanity/client manually. Then added apiVersion to sanity.json.

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

No branches or pull requests

2 participants