protected function resolveQuery(AstQuery $query)
{
$schema = $this->executionContext->getSchema();
$type = $query instanceof AstMutation ? $schema->getMutationType() : $schema->getQueryType();
$field = new Field(['name' => $query instanceof AstMutation ? 'mutation' : 'query', 'type' => $type]);
if (self::TYPE_NAME_QUERY == $query->getName()) {
return [$this->getAlias($query) => $type->getName()];
}
$this->resolveValidator->assetTypeHasField($type, $query);
$value = $this->resolveField($field, $query);
return [$this->getAlias($query) => $value];
}