darylldoyle / wp-graphql-offset-pagination Goto Github PK
View Code? Open in Web Editor NEWOffset pagination for WP GraphQL
License: GNU General Public License v3.0
Offset pagination for WP GraphQL
License: GNU General Public License v3.0
Upon activating and trying the query below I see this error in my PHP error logs:
PHP Fatal error: Uncaught Error: Call to undefined method WPGraphQL\Types::int() in /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php:31
Here's the full stack trace:
Stack trace:
#0 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php(19): Enshrined\OffsetPagination\OffsetPaginationType::fields()
#1 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/wp-graphql-offset-pagination.php(174): Enshrined\OffsetPagination\OffsetPaginationType->__construct()
#2 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/wp-graphql-offset-pagination.php(158): Enshrined\OffsetPagination::offset_pagination()
#3 /srv/www/lichfieldlive/public_html/wp-includes/class-wp-hook.php(305): Enshrined\OffsetPagination->add_input_fields()
#4 /srv/www/lichfieldlive/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters()
#5 /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql/src/Type/ in /srv/www/lichfieldlive/public_html/wp-content/plugins/wp-graphql-offset-pagination/src/OffsetPaginationType.php on line 31
Here's my query, which I'm running through GraphiQL in the dashboard:
query GetPosts($tagIds: [ID], $catIds: [ID], $authorId: [ID], $searchTerm: String) {
posts(
where: {
tagIn: $tagIds,
categoryIn: $catIds,
authorIn: $authorId,
search: $searchTerm
offsetPagination: {
page: $page,
per_page: $per_page
}
}
) {
node {
databaseId
featuredImage {
node {
altText
sourceUrl(size: POST_THUMBNAIL)
}
}
title
uri
}
}
}
Variables:
{
"page":1,
"per_page":10
}
I may have been looking in the wrong place but I'm not sure WPGraphQL\Types::int()
exists in the WP-GraphQL plugin. This is with WP-GraphQL v1.6.10, so maybe it was removed at some point?
Warning: require_once(/srv/bindings/ce661f7c68bc4050b305cd70005747b2/code/wp-content/plugins/wp-graphql-offset-pagination-master/vendor/autoload.php): failed to open stream: No such file or directory in /srv/bindings/ce661f7c68bc4050b305cd70005747b2/code/wp-content/plugins/wp-graphql-offset-pagination-master/wp-graphql-offset-pagination.php on line 135 Fatal error: require_once(): Failed opening required '/srv/bindings/ce661f7c68bc4050b305cd70005747b2/code/wp-content/plugins/wp-graphql-offset-pagination-master/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /srv/bindings/ce661f7c68bc4050b305cd70005747b2/code/wp-content/plugins/wp-graphql-offset-pagination-master/wp-graphql-offset-pagination.php on line 135
Hi
How do you query next page? Real life examples would pe very helpful, at the moment i can't figure out how i will get next page. Also the nextPage and previousPage queries are not working in WPGrapqhQL, are they dereceated?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.