You are here

public function ResolverRegistry::addTypeResolver in GraphQL 8.4

Add a type resolver.

@todo Type resolvers should also get their own interface.

Parameters

string $abstract:

callable $resolver:

Return value

$this

Overrides ResolverRegistryInterface::addTypeResolver

File

src/GraphQL/ResolverRegistry.php, line 135

Class

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

Namespace

Drupal\graphql\GraphQL

Code

public function addTypeResolver($abstract, callable $resolver) {
  $this->typeResolvers[$abstract] = $resolver;
  return $this;
}