-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Api Fetch: Fix fetch-all preloading. #23807
Conversation
Size Change: +41 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
I think we should close in favor of #23823 . Thoughts @epiqueras |
I think adding a shortcut for |
Yeah, why would adding an extra parameter be better than this? |
38255af
to
1962ed7
Compare
This doesn’t fix the issue. My pr fixes two issues. |
What issues? |
'/wp/v2/taxonomies?per_page=100&context=edit', | ||
'/wp/v2/pages?per_page=100&context=edit', | ||
'/wp/v2/taxonomies?context=edit', | ||
'/wp/v2/pages?context=edit', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'/wp/v2/pages?context=edit', | |
'/wp/v2/pages?per_page=100&context=edit', |
This should not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because pages is paginated, as pages requires a database call. Where taxonomies is call to registered taxonomies and is not paginated.
I will flip the question around on your @epiqueras why was it changed in the first place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't need 100 per page, the default is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we changed the pages fetch to not be a fetch all? If not, this preload won't match anymore because the fetch all middleware will force a per_page=100
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was never 100. It was always the default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a little testing, this change seems valid. I have one nit pick.
Fixes #23673