File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
CatalogGraphQl/Model/Resolver Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,10 @@ public function resolve(
110
110
111
111
$ currentPage = $ searchCriteria ->getCurrentPage ();
112
112
if ($ searchCriteria ->getCurrentPage () > $ maxPages && $ searchResult ->getTotalCount () > 0 ) {
113
- $ currentPage = new GraphQlInputException (
113
+ throw new GraphQlInputException (
114
114
__ (
115
- 'currentPage value %1 specified is greater than the number of pages available. ' ,
116
- [$ maxPages ]
115
+ 'currentPage value %1 specified is greater than the %2 page(s) available. ' ,
116
+ [$ currentPage , $ maxPages ]
117
117
)
118
118
);
119
119
}
@@ -123,7 +123,8 @@ public function resolve(
123
123
'items ' => $ searchResult ->getProductsSearchResult (),
124
124
'page_info ' => [
125
125
'page_size ' => $ searchCriteria ->getPageSize (),
126
- 'current_page ' => $ currentPage
126
+ 'current_page ' => $ currentPage ,
127
+ 'total_pages ' => $ maxPages
127
128
],
128
129
'filters ' => $ this ->filtersDataProvider ->getData ($ layerType )
129
130
];
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ input FilterTypeInput @doc(description: "FilterTypeInput specifies which action
29
29
type SearchResultPageInfo @doc (description : " SearchResultPageInfo provides navigation for the query response" ) {
30
30
page_size : Int @doc (description : " Specifies the maximum number of items to return" )
31
31
current_page : Int @doc (description : " Specifies which page of results to return" )
32
+ total_pages : Int @doc (description : " Total amount of pages" )
32
33
}
33
34
34
35
enum SortEnum @doc (description : " This enumeration indicates whether to return results in ascending or descending order" ) {
You can’t perform that action at this time.
0 commit comments