Filter to short circuit the callback for any field on a type. Returning anything other than null will stop the callback for the field from executing, and will return your data or execute your callback instead.
apply_filters( 'graphql_pre_return_field_from_model', null $return_field, string $key, string $model_name, mixed $data, string $visibility, int $owner, WP_User $current_user );
Params
- $return_field (null): The return field value, defaults to null
- $model_name (string): Name of the model the filter is currently being executed in
- $data (mixed): Name of the model the filter is currently being executed in
- $visibility (string): The visibility setting for this piece of data
- $owner (null|int): The user ID for the owner of this piece of data
- $current_user (WP_User): The current user for the session