Open brandonburrus opened 2 years ago
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
.
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 toMM-DD-YYYY
don't work because of this. For example, trying to use thept::text()
function causes the query to fail due to the configured client usingv1
, and notv2021-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.