From bd9d3ebdd8d37050c31f10283ee74b74131880d4 Mon Sep 17 00:00:00 2001 From: Artem Bykov <37114203+nisvem@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:54:10 +0200 Subject: [PATCH] Update Loader.php feat(graphql): add offsetPagination support for products connection - Register offsetPagination argument on RootQueryToProductUnionConnectionWhereArgs - Register offsetPagination metadata on RootQueryToProductUnionConnectionPageInfo --- src/Loader.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/Loader.php b/src/Loader.php index c7dd2d2..43cff26 100644 --- a/src/Loader.php +++ b/src/Loader.php @@ -263,5 +263,26 @@ function op_action_register_types() 'description' => 'Paginate users with offsets', ] ); + + // Add offsetPagination argument to the products connection (ProductUnion) + register_graphql_field( + 'RootQueryToProductUnionConnectionWhereArgs', + 'offsetPagination', + [ + 'type' => 'OffsetPagination', + 'description' => 'Paginate products with offsets', + ] + ); + + + // Add offsetPagination metadata to pageInfo for products + register_graphql_field( + 'RootQueryToProductUnionConnectionPageInfo', + 'offsetPagination', + [ + 'type' => 'OffsetPaginationPageInfo', + 'description' => 'Offset pagination metadata for products', + ] + ); } }