graphql_cursor_ordering_field

Filters the field used for ordering connection queries when cursors are used for pagination

apply_filters( 'graphql_cursor_ordering_field', array $field, \WPGraphQL\Data\Cursor\CursorBuilder $cursor_builder, \WPGraphQL\Data\Cursor\PostObjectCursor $object_cursor );

Params

  • $field (array): The field used for ordering the cursor.
    • $key (string): The field key
    • $value (string): The field value
    • $type (string): The type the field should be cast as
    • $order (string): The order the field should be ordered by
  • $cursor_builder (\WPGraphQL\Data\Cursor\CursorBuilder): The instance of the CursorBuilder class, passed to the filter for context
  • $object_cursor (\WPGraphQL\Data\Cursor\PostObjectCursor): The instance of the PostObjectCursor class, passed to the filter for context