Structure: Filter is required
Certain nodes within the Structure tool require a filter. A filter is the part of a GROQ query that specifies which documents should be matched — the constraints of a query, if you will.
Let's imagine you want to run a query to find all documents that do not currently have a slug set (in a field called slug). While the full GROQ query would look like this:
*[!defined(slug.current)]
The filter of the query on its own is:
!defined(slug.current)
Set a filter by calling the filter() method. Any filter other than a plain _type == $type check also needs apiVersion() — without it the Studio logs a warning to the console:
S.documentList()
.title('Missing slug')
.apiVersion('2025-02-19')
.filter('!defined(slug.current)')