-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Returns total of 0 for products #17
Comments
@WazzaJB if you have this filter in your code somewhere, delete it, it did set the thing to 0 for me too. Not using Woocommerce but it might help add_filter( 'graphql_connection_query_args', function( $query_args, \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection, $input_args ) {
if ( ! $connection->get_query() instanceof \WP_Query ) {
return $query_args;
}
$field_selection = $connection->getInfo()->getFieldSelection( 2 );
if ( isset( $field_selection['pageInfo']['total'] ) ) {
$query_args['no_found_rows'] = false;
}
return $query_args;
}, 10, 3 ); |
Thanks @FrozenAlex - I actually ended up just using the |
Is this working pagination correctly? Because cursor based pagination has bugs when use after. Its giving the same products for every cursor. I already had a logic for cursor based pagination but if this works I can move. |
I had this same issue where it was showing the same products too, but hadn't linked it to this. I ended up moving away from GraphQL entirely and querying the database directly with Kysely in my Node.JS app. Unfortunately performance of GraphQL and issues meant it wasn't really working out for me. |
Hey folks,
Appreciate you sharing this plugin, extremely useful for a project we're working on.
I'm having difficulties with it now on WordPress 6.5, WPGraphQL 1.27, and WPGraphQL-WooCommerce 0.20.0.
All my queries are now returning a total of
0
.I'm going to look at rolling back in the mean time but was wondering if anyone had ideas for a potential hotfix? PHP is not my forte these days but I am happy to work on a pull request!
Here is the query I am using:
Thanks in advance for any guidance you might be able to offer.
The text was updated successfully, but these errors were encountered: