diff --git a/source/composer.json b/source/composer.json index b13474d..a760827 100644 --- a/source/composer.json +++ b/source/composer.json @@ -13,7 +13,7 @@ "ext-mbstring": "*", "ext-openssl": "*", "ext-sodium": "*", - "wpackagist-plugin/wp-graphql": "1.15.0" + "wpackagist-plugin/wp-graphql": "1.16.0" }, "config": { "allow-plugins": { diff --git a/wp-graphql-stubs.php b/wp-graphql-stubs.php index b3d504d..baedae3 100644 --- a/wp-graphql-stubs.php +++ b/wp-graphql-stubs.php @@ -1109,11 +1109,11 @@ public function __construct() * and for their cursors to properly go forward/backward to the proper place in the database. * * @param string $orderby The ORDER BY clause of the query. - * @param \WP_Query $wp_query The WP_Query instance executing + * @param \WP_Query $query The WP_Query instance executing. * * @return string */ - public function graphql_wp_query_cursor_pagination_stability(string $orderby, \WP_Query $wp_query) + public function graphql_wp_query_cursor_pagination_stability(string $orderby, \WP_Query $query) { } /** @@ -1137,7 +1137,7 @@ public function graphql_wp_query_cursor_pagination_support(string $where, \WP_Qu * * @return string */ - public function graphql_wp_user_query_cursor_pagination_stability($orderby) + public function graphql_wp_user_query_cursor_pagination_stability($orderby, \WP_User_Query $query) { } /** @@ -2678,11 +2678,17 @@ abstract class AbstractCursor * @var array */ public $query_vars = []; + /** + * Stores SQL statement alias for the ID column applied to the cutoff + * + * @var string + */ + protected $id_key = ''; /** * The constructor * - * @param array $query_vars - * @param string|null $cursor + * @param array $query_vars Query variable for the query to be executed. + * @param string|null $cursor Cursor type. Either 'after' or 'before'. */ public function __construct($query_vars, $cursor = 'after') { @@ -2713,6 +2719,43 @@ public function get_cursor_compare() protected function is_valid_offset_and_node() { } + /** + * Validates cursor compare field configuration. Validation failure results in a fatal + * error because query execution is guaranteed to fail. + * + * @param array|mixed $field Threshold configuration. + * + * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. + * + * @return void + */ + protected function validate_cursor_compare_field($field) : void + { + } + /** + * Returns the ID key. + * + * @return mixed + */ + public function get_cursor_id_key() + { + } + /** + * Applies cursor compare fields to the cursor cutoff. + * + * @param array $fallback Fallback cursor compare fields. + * + * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. + */ + protected function compare_with_cursor_fields($fallback = []) : void + { + } + /** + * Applies ID field to the cursor builder. + */ + protected function compare_with_id_field() : void + { + } /** * Get the WP Object instance for the cursor. * @@ -2934,6 +2977,10 @@ class TermObjectCursor extends \WPGraphQL\Data\Cursor\AbstractCursor * @var integer */ public $meta_join_alias = 0; + /** + * {@inheritDoc} + */ + protected $id_key = 't.term_id'; /** * @param string $name The name of the query var to get *