You are here

interface ResolverRegistryInterface in GraphQL 8.4

Defines a registry to resolve any field in the GraphQL schema tree.

Hierarchy

Expanded class hierarchy of ResolverRegistryInterface

All classes that implement ResolverRegistryInterface

6 files declare their use of ResolverRegistryInterface
ComposableSchemaExampleExtension.php in examples/graphql_composable/src/Plugin/GraphQL/SchemaExtension/ComposableSchemaExampleExtension.php
ExampleSchemaExtension.php in examples/graphql_example/src/Plugin/GraphQL/SchemaExtension/ExampleSchemaExtension.php
SchemaExtensionPluginInterface.php in src/Plugin/SchemaExtensionPluginInterface.php
SchemaPluginInterface.php in src/Plugin/SchemaPluginInterface.php
SdlSchemaPluginBase.php in src/Plugin/GraphQL/Schema/SdlSchemaPluginBase.php

... See full list

File

src/GraphQL/ResolverRegistryInterface.php, line 13

Namespace

Drupal\graphql\GraphQL
View source
interface ResolverRegistryInterface {

  /**
   * Resolve a field.
   *
   * @param mixed $value
   * @param mixed $args
   * @param \Drupal\graphql\GraphQL\Execution\ResolveContext $context
   * @param \GraphQL\Type\Definition\ResolveInfo $info
   * @param \Drupal\graphql\GraphQL\Execution\FieldContext $field
   *
   * @return callable|null
   */
  public function resolveField($value, $args, ResolveContext $context, ResolveInfo $info, FieldContext $field);

  /**
   * Resolve a type.
   *
   * @param mixed $value
   * @param \Drupal\graphql\GraphQL\Execution\ResolveContext $context
   * @param \GraphQL\Type\Definition\ResolveInfo $info
   *
   * @return callable|null
   */
  public function resolveType($value, ResolveContext $context, ResolveInfo $info);

  /**
   * Add a field resolver for a certain type.
   *
   * @param string $type
   * @param string $field
   * @param \Drupal\graphql\GraphQL\Resolver\ResolverInterface $resolver
   *
   * @return $this
   */
  public function addFieldResolver($type, $field, ResolverInterface $resolver);

  /**
   * Return the field resolver for a given type and field name.
   *
   * @param string $type
   * @param string $field
   *
   * @return callable|null
   */
  public function getFieldResolver($type, $field);

  /**
   * Add a type resolver.
   *
   * @todo Type resolvers should also get their own interface.
   *
   * @param string $abstract
   * @param callable $resolver
   *
   * @return $this
   */
  public function addTypeResolver($abstract, callable $resolver);

  /**
   * Get the resolver for a given type name.
   *
   * @param string $type
   *
   * @return callable|null
   */
  public function getTypeResolver($type);

}

Members

Namesort descending Modifiers Type Description Overrides
ResolverRegistryInterface::addFieldResolver public function Add a field resolver for a certain type. 1
ResolverRegistryInterface::addTypeResolver public function Add a type resolver. 1
ResolverRegistryInterface::getFieldResolver public function Return the field resolver for a given type and field name. 1
ResolverRegistryInterface::getTypeResolver public function Get the resolver for a given type name. 1
ResolverRegistryInterface::resolveField public function Resolve a field. 1
ResolverRegistryInterface::resolveType public function Resolve a type. 1