# 0188-filters-graphql-object-fields

<!--
This file is auto-generated by scripts/hooks/generate-hook-docs.js.
Do not edit manually.
-->
---
title: graphql_object_fields
hookType: filter
hookGroup: schema-registration
plugin: wp-graphql
---

# graphql_object_fields

```php
apply_filters( 'graphql_object_fields', $fields, $type_name, $this, $this->type_registry );
```

Filter all object fields, passing the $typename as a param This is useful when several different types need to be easily filtered at once. . .for example, if ALL types with a field of a certain name needed to be adjusted, or something to that tune

- **Type:** filter
- **Group:** Schema Registration
- **Since:** 0.0.5
- **Source File:** `plugins/wp-graphql/src/Type/WPObjectType.php`

## Parameters

- `$fields` (`array<string,mixed>`): The array of fields for the object config
- `$type_name` (`string`): The name of the object type
- `$wp_object_type` (`\WPGraphQL\Type\WPObjectType`): The WPObjectType Class
- `$type_registry` (`\WPGraphQL\Registry\TypeRegistry`): The Type Registry

## Source

- [`plugins/wp-graphql/src/Type/WPObjectType.php:183`](https://github.com/wp-graphql/wp-graphql/blob/main/plugins/wp-graphql/src/Type/WPObjectType.php#L183)

```php
apply_filters( 'graphql_object_fields', $fields, $type_name, $this, $this->type_registry );
```

## Related

- `WPObjectType::prepare_fields()` in [`plugins/wp-graphql/src/Type/WPObjectType.php:183`](https://github.com/wp-graphql/wp-graphql/blob/main/plugins/wp-graphql/src/Type/WPObjectType.php#L183)

## Recipes

- [Deprecating a field in the Schema](/recipes/deprecating-a-field-in-the-schema)