Skip to content
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

0.3.1 only returns one paged set of events results with gatsby-source-wordpress #61

Open
james-wfaa opened this issue Oct 25, 2023 · 6 comments

Comments

@james-wfaa
Copy link
Contributor

When used with gatsby-source-wordpress, version 0.3.0 returns all events on a site during the sourcing phase.

Version 0.3.1 only returns one request's worth of events. gatsby-source-wordpress has a schema / perPage setting that controls "The number of nodes to fetch per page during node sourcing" https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/docs/plugin-options.md#schemaperpage

Whatever this value is set to (default is 100, but on my sites I use 20 or 40 due to constraints of my wordpress server), that's how many events are returned when running ql-events 0.3.1. If I have it set to 40, it gets the first 40 and stops. Or 20, or 100. For whatever reason it does not make any subsequent requests to go get the rest of the events that exist.

I tested this several times and got consistent results that 0.3.0 returns all events and 0.3.1 only returns the first paged batch. (I think a couple times it may have fetched two batches, 80 rather than 40... but it still wasn't returning all of them.

@kidunot89
Copy link
Collaborator

@james-wfaa What version of TEC are you using? And are you using TEC Pro?

@james-wfaa
Copy link
Contributor Author

@kidunot89 I've been running 6.2.8 TEC and 6.2.4 TEC Pro. I've been focused exclusively on QLEvents 0.3.1 recently and have made some progress. I have been able to resolve the pagination issue completely when not running TEC Pro by making a few small adjustments to includes/data/connection/class-event-connection-resolver.php. But it is continuing to break when TEC Pro is enabled. I submitted a PR and then canceled it because it was the wrong approach.

One thing I've been digging into is that pagination will break when the last two events in a page of results both have the same start time. I can definitely recreate that and share with you if you are interested. I've been exploring with adding additional sort params... start date AND end date... AND event name... but I think ultimately since the only value that has to be unique between two events is the database ID, you are going to want to incorporate that too somehow. Otherwise there is always at least the possibility of the pagination code getting confused by two distinct events that have all of the same attributes.

@kidunot89
Copy link
Collaborator

kidunot89 commented Dec 13, 2023

Have you enabled Events Pro support in plugin settings under GraphQL > Settings then the QL Events tab in the WP Admin?

@james-wfaa
Copy link
Contributor Author

james-wfaa commented Dec 13, 2023 via email

@kidunot89
Copy link
Collaborator

@james-wfaa Did you confirm that the setting was enabled?

@james-wfaa
Copy link
Contributor Author

james-wfaa commented Dec 19, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants