✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Specify API version when using custom document list filters

When specifying custom filters for document lists, we now require specifying an apiVersion. This can be set to the current date, e.g. v2023-08-28. See our API Versioning docs for more details.

Before:

S.documentList()
  .title('Posts')
  .filter('_type == "post" && $authorId == author._ref')
  .params({ authorId })

After:


  S.documentList()
    .title('Posts')
.apiVersion('v2023-08-01')
.filter('_type == "post" && $authorId == author._ref') .params({ authorId }) )

Was this article helpful?