You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to support pagination of individual facet statistics within group of facet summary. Currently, all facet statistics within a group are returned every time. The problem is there may be tens or hundreds of facets within a single group and typically we want to render only e.g. first 10 facets in a side menu on frontend.
However, we don't want to make the returned facet statistics array more complex by wrapping it into a PaginatedList or something because that would make the API difficult to work with when there is multiple different groups and types of facet summary. And sometimes we don't care about the pagination in this area at all.
That why we've come up with following syntax in GraphQL:
Each facet group would provide total facet count as facetCount next to the actual facetStatistics field, and the facetStatstics field would have option to define pagination within require constraint container (we don't want to provide paging arguments directly in the field, because we want to support both page and strip, which would result in confusing parameters). However in GraphQL, we could alias the require parameter to something like pagination to not give a false idea that a developer can put more constraints inside (in Java there could be maybe interface for it?).
{
queryProduct {
extraResults {
facetSummary {
groups {
facetCount # total facet count within returned group, ignoring pagination of facets, replacing the need for entire DataChunk structurefacetStatistics(
require: { # standard require constraint container limited to page and strip constraintspage: { number: 1, size: 10 }
# orstrip: { limit: 10, offset: 0 }
}
) {
facetEntity {
attributes {
nameurldescription
}
}
}
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
We want to support pagination of individual facet statistics within group of facet summary. Currently, all facet statistics within a group are returned every time. The problem is there may be tens or hundreds of facets within a single group and typically we want to render only e.g. first 10 facets in a side menu on frontend.
However, we don't want to make the returned facet statistics array more complex by wrapping it into a
PaginatedList
or something because that would make the API difficult to work with when there is multiple different groups and types of facet summary. And sometimes we don't care about the pagination in this area at all.That why we've come up with following syntax in GraphQL:
Each facet group would provide total facet count as
facetCount
next to the actualfacetStatistics
field, and thefacetStatstics
field would have option to define pagination within require constraint container (we don't want to provide paging arguments directly in the field, because we want to support bothpage
andstrip
, which would result in confusing parameters). However in GraphQL, we could alias therequire
parameter to something likepagination
to not give a false idea that a developer can put more constraints inside (in Java there could be maybe interface for it?).The text was updated successfully, but these errors were encountered: