Showing Post Type labels in public queries
WPGraphQL respects WordPress core access control rights. This means that data that is only available to authenticated users in the WordPress admin is only available to authenticated users making GraphQL requests.
Sometimes, you want to expose fields that are restricted by default.
Take the Post Type Label field, for example.
Querying for the label of a Post Type as a public user returns a
null value by default:
With the following snippet, you can expose the
label field to public users:
And below we can see the same query, showing the value of the labels to public users.