You are here

protected function TypeResolver::getFirstApplicableTypeResolver in GraphQL 8.2

Same name and namespace in other branches
  1. 8 src/TypeResolver.php \Drupal\graphql\TypeResolver::getFirstApplicableTypeResolver()

Returns the first applicable provider for the given type definition.

Parameters

mixed $type:

Return value

\Drupal\graphql\TypeResolverInterface|null

1 call to TypeResolver::getFirstApplicableTypeResolver()
TypeResolver::resolveRecursive in src/TypeResolver.php

File

src/TypeResolver.php, line 50

Class

TypeResolver
Attempts to GraphQL type definitions from arbitrary data types.

Namespace

Drupal\graphql

Code

protected function getFirstApplicableTypeResolver($type) {
  foreach ($this
    ->getSortedResolvers() as $resolver) {
    if ($resolver
      ->applies($type)) {
      return $resolver;
    }
  }
  return NULL;
}