Archives: Filters

  • graphql_user_can_see_trace_data

    Filter whether the logs can be seen in the request results or not

    apply_filters( 'graphql_user_can_see_trace_data', bool $can_see );

    Params

    • $can_see (bool): Whether the requestor can see the logs or not
  • graphql_term_object_insert_term_args

    Filter the $insert_args

    apply_filters( 'graphql_term_object_insert_term_args', array $insert_args, array $input, WP_Taxonomy $taxonomy, string $mutation_name );

    Params

    • $insert_args (array): The array of input args that will be passed to the functions that insert terms
    • $input (array): The data that was entered as input for the mutation
    • $taxonomy (WP_Taxonomy): The taxonomy object of the term being mutated
    • $mutation_name (string): The name of the mutation being performed (create, edit, etc)
  • graphql_map_input_fields_to_get_terms

    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_terms query.

    apply_filters( 'graphql_map_input_fields_to_get_terms', array $query_args, array $where_args, string $taxonomy, 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
    • $taxonomy (string): The name of the taxonomy
    • $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
  • graphql_term_object_connection_query_args

    Filter the query_args that should be applied to the query. This filter is applied AFTER the input args from the GraphQL Query have been applied and has the potential to override the GraphQL Query Input Args.

    apply_filters( 'graphql_term_object_connection_query_args', array $query_args, mixed $source, array $args, AppContext $context, ResolveInfo $info );

    Params

    • $query_args (array): array of query_args being passed to the
    • $source (mixed): source passed down from the resolve tree
    • $args (array): array of arguments input in the field as part of the GraphQL query
    • $context (AppContext): object passed down the resolve tree
    • $info (ResolveInfo): info about fields passed down the resolve tree
  • graphql_settings_sections

    Filter the settings sections

    apply_filters( 'graphql_settings_sections', array $settings_sections );

    Params

    • $settings_sections (array): The registered settings sections
  • graphql_setting_field_config

    Filter the setting field config

    apply_filters( 'graphql_setting_field_config', array $field_config, string $field_name, string $section );

    Params

    • $field_config (array): The field config for the setting
    • $field_name (string): The name of the field (unfilterable in the config)
    • $section (string): The slug of the section the field is registered to
  • graphql_response_status_code

    Filter the $status_code before setting the headers

    apply_filters( 'graphql_response_status_code', int $http_status_code, array $response, array $graphql_results, string $query, string $operation_name, array $variables, WP_User $user );

    Params

    • $http_status_code (int): The status code to apply to the headers
    • $response (array): The response of the GraphQL Request
    • $graphql_results (array): The results of the GraphQL execution
    • $query (string): The GraphQL query
    • $operation_name (string): The operation name of the GraphQL Request
    • $variables (array): The variables applied to the GraphQL Request
    • $user (WP_User): The current user object
  • graphql_response_headers_to_send

    Filter the $headers to send

    apply_filters( 'graphql_response_headers_to_send', array $headers );

    Params

    • $headers (array): Array of headers to filter
  • graphql_send_nocache_headers

    Filter to determine if nocache headers are sent on authenticated requests.

    apply_filters( 'graphql_send_nocache_headers', bool $send_headers );

    Params

    • $send_headers (bool): If the headers should be sent, defaults to the return value of is_user_logged_in()
  • graphql_access_control_allow_headers

    Filtered list of access control headers

    apply_filters( 'graphql_access_control_allow_headers', array $access_control_headers );

    Params

    • $access_control_headers (array): Array of headers to allow