-
Notifications
You must be signed in to change notification settings - Fork 449
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
feat: prev/next on edge #1133
Comments
@moonmeister I have a GIST that may apply here: https://gist.github.com/jasonbahl/55a6eff4cd67ce639ecd2d9989fef4cc I've been thinking about adding support for this, but haven't landed on an ideal implementation. I plan on doing some work on Connections in an upcoming release, so this could be a good time to dive more into this. |
That gist is for older version of WP-GQL I think, this is an updated version that we use all the time: https://github.com/funkhaus/stackhaus-backend/blob/master/functions/gql-functions.php#L32-L146 |
@drewbaker am curious which file do you add that code in your gist? |
In your themes functions.php file |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. If you believe this issue is still valid, please open a new issue and mark this as a related issue. |
I'm hoping this can also apply to single post queries the way that WPGraphql Next-Previous Post allows:
Additionally, for my use case I need to paginate based on a post category/tag. So for a given post I'd like the next and prev post to behave is if it's only paginating across the set of posts tagged with |
I've seem other GraphQL APIs on CMSs provide
prev
andnext
connections on a node edge. This would be helpful in my case for creating page level navigation for next post and previous post. I've solved this in JS for now but it would be nice for these to be available in query. It would look something like:The text was updated successfully, but these errors were encountered: