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

  • UserConnectionArgs
  • UserConnectionDefinition
  • UserConnectionResolver

Class UserConnectionResolver

Class UserConnectionResolver

WPGraphQL\Data\ConnectionResolver implements WPGraphQL\Data\ConnectionResolverInterface
Extended by WPGraphQL\Type\User\Connection\UserConnectionResolver
Namespace: WPGraphQL\Type\User\Connection
Package: WPGraphQL\Data\Resolvers
Since: 0.5.0
Located at Type/User/Connection/UserConnectionResolver.php

Methods summary

public static WP_User_Query
# get_query( $query_args )

This runs the query and returns the repsonse

This runs the query and returns the repsonse

Parameters

$query_args

Returns

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

This returns the $query_args that should be used when querying for posts in the postObjectConnectionResolver. This checks what input $args are part of the query, combines them with various filters, etc and returns an array of $query_args to be used in the \WP_Query call

This returns the $query_args that should be used when querying for posts in the postObjectConnectionResolver. This checks what input $args are part of the query, combines them with various filters, etc and returns an array of $query_args to be used in the \WP_Query call

Parameters

$source
The query source being passed down to the resolver
$args
The arguments that were provided to the query
$context
Object containing app context that gets passed down the resolve tree
$info
Info about fields passed down the resolve tree

Returns

array

Throws

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

This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_User_Query friendly keys.

This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_User_Query friendly keys.

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
The query "where" args
$source
The query results of the query calling this relation
$all_args
Array of all the query args (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_connection(), get_offset(), get_query_amount(), get_query_info(), resolve()

API documentation generated by ApiGen