Filter for the allowed restricted fields

apply_filters( 'graphql_allowed_fields_on_restricted_type', $allowed_restricted_fields, $model_name, $data, $visibility, $owner, $current_user );


  • $allowed_restricted_fields (array): The fields to allow when the data is designated as restricted to the current user
  • $model_name (string): Name of the model the filter is currently being executed in
  • $data (mixed): The un-modeled incoming data
  • $visibility (string|null): The visibility that has currently been set for the data at this point
  • $owner (null|int): The user ID for the owner of this piece of data
  • $current_user (WP_User): The current user for the session