Overview
  • Namespace
  • Class

Namespaces

  • WPGraphQL
    • Data
    • Type
      • Avatar
      • Comment
        • Connection
      • CommentAuthor
      • EditLock
      • Enum
      • MediaItem
        • Mutation
      • Plugin
        • Connection
      • PostObject
        • Connection
        • Mutation
      • PostType
      • Setting
      • Taxonomy
      • TermObject
        • Connection
        • Mutation
      • Theme
        • Connection
      • Union
      • User
        • Connection
        • Mutation
    • Utils

Classes

  • Config
  • ConnectionResolver
  • DataSource
  • Loader

Interfaces

  • ConnectionResolverInterface

Class Config

Class Config

This class contains configurations for various data-related things, such as query filters for cursor pagination.

Namespace: WPGraphQL\Data
Package: WPGraphQL\Data
Located at Data/Config.php

Methods summary

public
# __construct( )

Config constructor.

Config constructor.

public string
# graphql_wp_query_cursor_pagination_support( string $where, WP_Query $query )

This filters the WPQuery 'where' $args, enforcing the query to return results before or after the referenced cursor

This filters the WPQuery 'where' $args, enforcing the query to return results before or after the referenced cursor

Parameters

$where
The WHERE clause of the query.
$query
The WP_Query instance (passed by reference).

Returns

string
public array
# graphql_wp_term_query_cursor_pagination_support( array $pieces, array $taxonomies, array $args )

This filters the term_clauses in the WP_Term_Query to support cursor based pagination, where we can move forward or backward from a particular record, instead of typical offset pagination which can be much more expensive and less accurate.

This filters the term_clauses in the WP_Term_Query to support cursor based pagination, where we can move forward or backward from a particular record, instead of typical offset pagination which can be much more expensive and less accurate.

Parameters

$pieces
Terms query SQL clauses.
$taxonomies
An array of taxonomies.
$args
An array of terms query arguments.

Returns

array
$pieces
public array
# graphql_wp_comments_query_cursor_pagination_support( array $pieces, WP_Comment_Query $query )

This returns a modified version of the $pieces of the comment query clauses if the request is a GRAPHQL_REQUEST and the query has a graphql_cursor_offset defined

This returns a modified version of the $pieces of the comment query clauses if the request is a GRAPHQL_REQUEST and the query has a graphql_cursor_offset defined

Parameters

$pieces
A compacted array of comment query clauses.
$query
Current instance of WP_Comment_Query, passed by reference.

Returns

array
$pieces
API documentation generated by ApiGen