-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Setting amount of products in pagination not working #827
Comments
Just tested with v0.19.0 and having the same issue with pagination Query:
Response:
|
Same issue here |
Any update on this issue? |
I've been able to track this down to these lines of code: $model = $this->get_node_by_id( $id );
if ( true === $this->is_valid_model( $model ) ) {
$nodes[ $id ] = $model;
} here: Somehow some products aren't a valid model and those get filtered out. Unfortunately I haven't been able to figure out why. Hope this helps on finding a solution, I'm currently blocked from updating from |
I encountered something similar and found that unpublished products i.e. draft products were consuming the "first" limit but not actually being returned, adding where: { status: "PUBLISHED" } to the query seemed to do the trick for me. |
@MonPetitUd @kpoelhekke @claudio-uey @YishaqG Do you guys have Enable Unsupported Types setting activated? Does it make a difference in the result count? |
@kidunot89 I don't be that setting was enabled when I encountered this issue. |
@kidunot89 here toggling that setting doesn't have any effect. The query: query NewQuery {
products(first: 48, where: {typeIn: [GROUPED]}) {
edges {
node {
id
name
}
}
pageInfo {
offsetPagination {
total
}
}
}
} returns 47 items with the setting on and off. |
Describe the bug
Using query
products
setting first misbehaves not always returns the requested amount of elements.To Reproduce
products
withfirst
> 10Expected behavior
Returns the set amount
Plugin Versions
WooGraphQL Version: 0.18.3
WPGraphQL Version: 1.19.0
WordPress Version: 6.4.2
WooCommerce Version: 8.3.1
The text was updated successfully, but these errors were encountered: