register_graphql_fields

register_graphql_fields( string $type_name, array $fields ): void;

Given a Type Name and an array of field configs, this adds the fields to the registered type in the TypeRegistry

  • Since: 0.1.0
  • Source File: plugins/wp-graphql/access-functions.php

Parameters

  • $type_name (string): The name of the Type to add the fields to
  • $fields (array<string,array<string,mixed>>): An array of field configs

Throws

  • \Exception

Source

function register_graphql_fields( string $type_name, array $fields ): void {