Filter to add restricted field on Model
Labels on Post Types are not publicly exposed by WordPress. They are attributes for use in the Admin, and are treated with respect to proper access to the admin.
To see the labels, the user requesting them must be authenticated.
When a user requesting a
PostType, these are the following fields that are by default allowed to be viewed by a public request: https://github.com/wp-graphql/wp-graphql/blob/develop/src/Model/PostType.php#L59
You can use the
graphql_allowed_fields_on_restricted_type filter to expose more fields publicly if you chose to do so: https://github.com/wp-graphql/wp-graphql/blob/develop/src/Model/Model.php#L292
Before adding the filter:
After adding the filter: