Core Data: Add 'supportsPagination' to all appropriate entities#71302
Core Data: Add 'supportsPagination' to all appropriate entities#71302
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @yeetien. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
We should also enable it for individual taxonomies, like Category - https://developer.wordpress.org/rest-api/reference/categories/#arguments. Update: gutenberg/packages/core-data/src/entities.js Lines 383 to 398 in 79e96b5 |
|
Size Change: +15 B (0%) Total Size: 1.92 MB
ℹ️ View Unchanged
|
So not a blanket rule in |
|
The |
…ents, and plugins. This is so totalItems and totalPages is correctly set in meta from the X headers
cc4955e to
bf36045
Compare
|
Flaky tests detected in bf36045. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/17207150523
|
Thank you @Mamaduka |
|
Sorry, folks, I am out of practice, I forgot the following in the commit 🤦🏻 |
priethor
left a comment
There was a problem hiding this comment.
Thanks all, I was going to fix this for taxonomies, so seeing this was a pleasant surprise ❤️

What? How? Why?
This PR adds the
supportsPaginationproperty to rootEntitiesConfig for user, comment, and taxonomy entities.This is so
totalItemsandtotalPagesare correctly set in meta from theX-WP-TotalandX-WP-TotalPagesheaders.Also, to quote #55164
An example use case would be rendering a dataviews list of comments or users, and accurate totals are required.
See: https://github.com/WordPress/gutenberg/blob/add/entities-support-pagination/packages/core-data/src/resolvers.js#L281
Closes #59520
Testing Instructions
I tested by adding a lot of users, e.g.,
Then I fetched users:
This will return 10 entries by default.
Then I checked the total:
This should return 150 (plus how many users you had already).
In trunk, you'd see
10because that's how many users are in the store.