Skip to content

Commit

Permalink
Fix Input value building into directives
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Jan 16, 2018
1 parent d8df098 commit 44caa07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/SDL/Reflection/Builder/DocumentBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Railt\Reflection\Base\BaseDocument;
use Railt\Reflection\Contracts\Definitions\Definition;
use Railt\Reflection\Contracts\Definitions\TypeDefinition;
use Railt\Reflection\Contracts\Invocations\Invocable;
use Railt\Reflection\Support;
use Railt\SDL\Exceptions\BuildingException;
use Railt\SDL\Exceptions\CompilerException;
Expand Down Expand Up @@ -100,12 +101,12 @@ public function future(Compilable $type): self
}

/**
* @return iterable
* @return iterable|Invocable[]|Compilable[]
*/
public function getInvocableTypes(): iterable
{
if ($this->future && $this->future->count()) {
yield from $this->future;
while ($this->future->count() > 0) {
yield $this->future->pop();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Railt\Compiler\Ast\NodeInterface;
use Railt\Compiler\Ast\RuleInterface;
use Railt\Reflection\Base\Invocations\BaseDirectiveInvocation;
use Railt\Reflection\Contracts\Definitions\DirectiveDefinition;
use Railt\Reflection\Contracts\Definitions\TypeDefinition;
use Railt\Reflection\Contracts\Document;
use Railt\SDL\Reflection\Builder\DocumentBuilder;
Expand Down Expand Up @@ -48,7 +49,14 @@ protected function onCompile(NodeInterface $ast): bool
if ($ast->is('#Argument')) {
[$name, $value] = $this->parseArgumentValue($ast);

$this->arguments[$name] = $this->parseValue($value, $this->getName());
/** @var DirectiveDefinition $type */
$type = $this->getTypeDefinition();

$this->arguments[$name] = $this->parseValue($value, $type
->getArgument($name)
->getTypeDefinition()
->getName()
);

return true;
}
Expand Down

0 comments on commit 44caa07

Please sign in to comment.