Skip to content

Commit

Permalink
Added forgotten check to validate variable directive usage during nor…
Browse files Browse the repository at this point in the history
…malization
  • Loading branch information
peldax committed Nov 30, 2021
1 parent e0ba865 commit 1c6a3cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Normalizer/Normalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ private function normalizeDirectiveSet(
$directiveTypes[$directiveDef->getName()] = true;
}

if ($usage instanceof \Graphpinator\Normalizer\Variable\Variable) {
\assert($directiveDef instanceof \Graphpinator\Typesystem\Location\VariableDefinitionLocation);
$directiveDef->validateVariableUsage($usage, $normalizedDirective->getArguments());
}

$normalized[] = $normalizedDirective;
$this->path->pop();
}
Expand Down

0 comments on commit 1c6a3cc

Please sign in to comment.