I'd like to see the same options (particularly limiting, e.g. to the first 3 entries, but also filtering) that fields like all<ContentType>s
have, on the repeatable zone field on slices.
Example:
My Page
type has a slice called user_stories
, and this slice has a repeatable zone with various fields inside.
I am able to limit and filter a query for allPages
such as allPages(first: 3) { ... }
or filter such as allPages(where: { ... }) { ... }
.
But I can't do these operations on the slice's repeatable zone.
page(...) {
body {
...on PageUser_stories {
fields(first: 3) { ← no such parameters
my_field
}
}
}
}
My use case is a slice which is a spotlight on some particular pages of the website. When rendered it will only ever display a maximum of 3. I can't limit the number of items in the repeatable slice in Prismic but this is fine, since the client will find it useful to enter the data for more than 3, and swap them in and out from time to time by reordering them.
I ideally don't want the application to load more data than it needs to -- I'd like it to just query for the first 3.