You are here

public function ResolverRegistry::addFieldResolver in GraphQL 8.4

Add a field resolver for a certain type.

Parameters

string $type:

string $field:

\Drupal\graphql\GraphQL\Resolver\ResolverInterface $resolver:

Return value

$this

Overrides ResolverRegistryInterface::addFieldResolver

File

src/GraphQL/ResolverRegistry.php, line 108

Class

ResolverRegistry
Contains all the mappings how to resolve a GraphQL request.

Namespace

Drupal\graphql\GraphQL

Code

public function addFieldResolver($type, $field, ResolverInterface $resolver) {
  $this->fieldResolvers[$type][$field] = $resolver;
  return $this;
}