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

  • TermObjectConnectionArgs
  • TermObjectConnectionDefinition
  • TermObjectConnectionResolver

Class TermObjectConnectionResolver

Class TermObjectConnectionResolver

WPGraphQL\Data\ConnectionResolver implements WPGraphQL\Data\ConnectionResolverInterface
Extended by WPGraphQL\Type\TermObject\Connection\TermObjectConnectionResolver
Namespace: WPGraphQL\Type\TermObject\Connection
Package: WPGraphQL\Data\Resolvers
Since: 0.0.5
Located at Type/TermObject/Connection/TermObjectConnectionResolver.php

Methods summary

public
# __construct( $taxonomy )

TermObjectConnectionResolver constructor.

TermObjectConnectionResolver constructor.

Parameters

$taxonomy
public static array
# get_query_args( $source, array $args, WPGraphQL\AppContext $context, GraphQL\Type\Definition\ResolveInfo $info )

Returns an array of query_args to use in the WP_Term_Query to fetch the necessary terms for the connection

Returns an array of query_args to use in the WP_Term_Query to fetch the necessary terms for the connection

Parameters

$source
$args
$context
$info

Returns

array
public static WP_Term_Query
# get_query( $query_args )

This runs the query and returns the response

This runs the query and returns the response

Parameters

$query_args

Returns

WP_Term_Query
public static array
# get_connection( array|mixed $query, array $items, mixed $source, array $args, WPGraphQL\AppContext $context, GraphQL\Type\Definition\ResolveInfo $info )

This gets the connection to return

This gets the connection to return

Parameters

$query
The query that was processed to get data
$items
The array slice that was returned
$source
The source being passed down the resolve tress
$args
The input args for the resolving field
$context
The context being passed down the resolve tree
$info
The ResolveInfo passed down the resolve tree

Returns

array

Overrides

WPGraphQL\Data\ConnectionResolver::get_connection
public static array
# get_edges( $items, $source, $args, $context, $info )

Takes an array of items and returns the edges

Takes an array of items and returns the edges

Parameters

$items
$source
$args
$context
$info

Returns

array
public static array
# sanitize_input_fields( array $args, mixed $source, array $all_args, WPGraphQL\AppContext $context, GraphQL\Type\Definition\ResolveInfo $info )

This maps the GraphQL "friendly" args to get_terms $args. There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be down to explore more dynamic ways to map this, but for now this gets the job done.

This maps the GraphQL "friendly" args to get_terms $args. There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be down to explore more dynamic ways to map this, but for now this gets the job done.

Parameters

$args
Array of query "where" args
$source
The query results
$all_args
All of the query arguments (not just the "where" args)
$context
The AppContext object
$info
The ResolveInfo object

Returns

array

Since

0.0.5

Methods inherited from WPGraphQL\Data\ConnectionResolver

get_amount_requested(), get_array_meta(), get_array_slice(), get_offset(), get_query_amount(), get_query_info(), resolve()

Properties summary

public static string $taxonomy

Stores the name of the taxonomy for the connection being resolved

Stores the name of the taxonomy for the connection being resolved

#
API documentation generated by ApiGen