Specify API version when using custom document list filters
Custom document list filters in Structure Builder require an `apiVersion`. Learn where to add `.apiVersion()` and what value to set.
Sanity Studio logs a warning when a document list uses a custom filter without an apiVersion. It will be required in a future version. Until then, omitting it falls back to the Studio's default API version, 2025-02-19. Set it to a date, for example v2025-02-19. For more information, see API versioning.
The warning reads No apiVersion specified for document type list with custom filter: <your filter>. This will be required in the future. See <url> for more info.
Filter without an API version
This filter logs a warning, because it does not specify an apiVersion:
S.documentList()
.title('Posts')
.filter('_type == "post" && $authorId == author._ref')
.params({ authorId })Filter with an API version
Add .apiVersion() to the document list. This is the recommended form:
S.documentList()
.title('Posts')
.apiVersion('v2025-02-19')
.filter('_type == "post" && $authorId == author._ref')
.params({ authorId })