Archives: Filters

  • graphql_field_definition

    Filter the field definition

    apply_filters( 'graphql_field_definition', GraphQL\Type\Definition\FieldDefinition $field, string $type_name );

    Params

    • $field (GraphQL\Type\Definition\FieldDefinition): The field definition
    • $type_name (string): The name of the Type the field belongs to
  • graphql_debug_log

    Return the filtered debug log

    apply_filters( 'graphql_debug_log', array $logs, DebugLog $debug_log );

    Params

    • $logs (array): The logs to be output with the request
    • $debug_log (DebugLog): The DebugLog class
  • graphql_debug_log_entry

    Filter the log entry for the debug log

    apply_filters( 'graphql_debug_log_entry', array $log_entry, array $config );

    Params

    • $log_entry (array): The log entry
    • $config (array): The config passed in with the log entry
  • graphql_resolve_node_type

    Add a filter to allow externally registered node types to return the proper type based on the node_object that’s returned

    apply_filters( 'graphql_resolve_node_type', mixed $type, mixed $node );

    Params

    • $type (mixed|object|array): The type definition the node should resolve to
    • $node (mixed|object|array): The $node that is being resolved
  • graphql_allowed_setting_groups

    Filter the $allowed_settings to allow some to be enabled or disabled from showing in the GraphQL Schema

    apply_filters( 'graphql_allowed_setting_groups', $allowed_settings );

    Params

    • $allowed_settings (array): The allowed settings values
  • graphql_allowed_settings_by_group

    Filter the $allowed_settings_by_group to allow enabling or disabling groups in the GraphQL Schema

    apply_filters( 'graphql_allowed_settings_by_group', $allowed_settings_by_group );

    Params

    • $allowed_settings_by_group (array): Settings array to enable or disable groups
  • graphql_users_orderby

    Filters the ORDER BY clause of the query

    apply_filters_ref_array( 'graphql_users_orderby', [ string $query->query_orderby, WP_User_Query &$query ] );

    Params

    • $ref_array (array): The array of parameters
      • $orderby (string): The ORDER BY clause of the query
      • $query (WP_User_Query): The WP_User_Query instance (passed by reference)
  • graphql_users_where

    Filters the WHERE clause of the query.

    Specifically for manipulating paging queries.

    apply_filters_ref_array( 'graphql_users_where', [ string $query->query_where, WP_User_Query &$query ] );
    • $ref_array (array): The array of parameters
      • $where (string): The WHERE clause of the query
      • $query (WP_User_Query): The WP_User_Query instance (passed by reference)
  • graphql_comment_insert_post_args

    Filter the $insert_post_args

    apply_filters( 'graphql_comment_insert_post_args', array $output_args, array $input, string $mutation_name );

    Params

    • $output_args (array): The array of $input_post_args that will be passed to wp_new_comment
    • $input (array): The data that was entered as input for the mutation
    • $mutation_type (string): The type of mutation being performed ( create, edit, etc )
  • graphql_map_input_fields_to_wp_comment_query

    Filter the input fields. This allows plugins/themes to hook in and alter what $args should be allowed to be passed from a GraphQL Query to the get comments query.

    apply_filters( 'graphql_map_input_fields_to_wp_comment_query', array $query_args, array $where_args, mixed $source, array $all_args, AppContext $context, ResolveInfo $info );

    Params

    • $query_args (array): Array of mapped query args
    • $where_args (array): Array of query “where” args
    • $source (mixed): The query results
    • $all_args (array): All of the query arguments (not just the “where” args)
    • $context (AppContext): The AppContext object
    • $info (ResolveInfo): The ResolveInfo object