graphql_model_prepare_fields

apply_filters( 'graphql_model_prepare_fields', $this->fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user );

Filter the array of fields for the Model before the object is hydrated with it

  • Type: filter
  • Group: Model Layer
  • Since: 1.7.0
  • Source File: plugins/wp-graphql/src/Model/Model.php

Parameters

  • $fields (array<string,mixed>): The array of fields for the model
  • $model_name (string): Name of the model the filter is currently being executed in
  • $data (TData): The un-modeled incoming data
  • $visibility (string): The visibility setting for this piece of data
  • $owner (?int): The user ID for the owner of this piece of data
  • $current_user (\WP_User): The current user for the session

Source

apply_filters( 'graphql_model_prepare_fields', $this->fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user );