You are here

protected function GraphQL::defineOptions in GraphQL 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/views/display/GraphQL.php \Drupal\graphql\Plugin\views\display\GraphQL::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides DisplayPluginBase::defineOptions

File

src/Plugin/views/display/GraphQL.php, line 77

Class

GraphQL
Provides a display plugin for GraphQL views.

Namespace

Drupal\graphql\Plugin\views\display

Code

protected function defineOptions() {
  $options = parent::defineOptions();

  // Set the default style plugin to 'json'.
  $options['row']['contains']['type']['default'] = 'data_entity';
  $options['defaults']['default']['style'] = FALSE;
  $options['defaults']['default']['row'] = FALSE;

  // Remove css/exposed form settings, as they are not used for the data display.
  unset($options['exposed_form']);
  unset($options['exposed_block']);
  unset($options['css_class']);
  return $options;
}