You are here

public static function InputTypePluginBase::createInstance in GraphQL 8.3

Parameters

\Drupal\graphql\Plugin\SchemaBuilderInterface $builder:

\Drupal\graphql\Plugin\TypePluginManager $manager:

$definition:

$id:

Return value

mixed

Overrides TypePluginInterface::createInstance

File

src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php, line 23

Class

InputTypePluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\InputTypes

Code

public static function createInstance(SchemaBuilderInterface $builder, TypePluginManager $manager, $definition, $id) {
  return new InputObjectType([
    'name' => $definition['name'],
    'description' => $definition['description'],
    'contexts' => $definition['contexts'],
    'fields' => function () use ($builder, $definition) {
      return $builder
        ->processArguments($definition['fields']);
    },
  ]);
}