funkhaus / fuxt-backend

A theme that turns WordPress into a true Headless CMS. Optimized for the fuxt frontend boilerplate and fuxt-api plugin.
GNU General Public License v3.0
101 stars 19 forks source link

NextPage returns random page #44

Closed dChiamp closed 1 year ago

dChiamp commented 1 year ago

NextPage gql query is consistently returning incorrect pages. This is unrelated to the recent looping update which works well, as its happening on older sites that weren't updates (like soda).

Here's a query example:

pages-query

you can see from the page structure that's incorrect

pages-next

NextPost is working as expected:

posts-query posts-next
drewbaker commented 1 year ago

If I understand the code that @rsm0128 wrote, this actually doesn't work for hierarchy posts anymore, which is wrong. For posts with hierarchy to them (like Pages) there would need to be much different logic.

drewbaker commented 1 year ago

See this function for how it worked for Pages: https://github.com/funkhaus/fuxt-backend/issues/39

drewbaker commented 1 year ago

Fixed with https://github.com/funkhaus/fuxt-backend/commit/7e6c95b061efbc894d4781793579c70c63a232be