You are here

class ExecutorFactory in GraphQL 8.4

Service to make our GraphQL executor, can be swapped out.

Hierarchy

Expanded class hierarchy of ExecutorFactory

1 string reference to 'ExecutorFactory'
graphql.services.yml in ./graphql.services.yml
graphql.services.yml
1 service uses ExecutorFactory
graphql.executor in ./graphql.services.yml
Drupal\graphql\GraphQL\Execution\ExecutorFactory

File

src/GraphQL/Execution/ExecutorFactory.php, line 13

Namespace

Drupal\graphql\GraphQL\Execution
View source
class ExecutorFactory {

  /**
   * The service container.
   *
   * @var \Symfony\Component\DependencyInjection\ContainerInterface
   */
  protected $container;

  /**
   * ExecutorFactory constructor.
   *
   * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
   */
  public function __construct(ContainerInterface $container) {
    $this->container = $container;
  }

  /**
   * Factory method to make a new executor.
   *
   * @param \GraphQL\Executor\Promise\PromiseAdapter $adapter
   * @param \GraphQL\Type\Schema $schema
   * @param \GraphQL\Language\AST\DocumentNode $document
   * @param mixed $root
   * @param \Drupal\graphql\GraphQL\Execution\ResolveContext $context
   * @param mixed $variables
   * @param string $operation
   * @param callable $resolver
   *
   * @return \Drupal\graphql\GraphQL\Execution\Executor
   */
  public function create(PromiseAdapter $adapter, Schema $schema, DocumentNode $document, $root, ResolveContext $context, $variables, $operation, callable $resolver) {
    return Executor::create($this->container, $adapter, $schema, $document, $context, $root, $variables, $operation, $resolver);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExecutorFactory::$container protected property The service container.
ExecutorFactory::create public function Factory method to make a new executor.
ExecutorFactory::__construct public function ExecutorFactory constructor.