Skip to content

Commit cefa92f

Browse files
committedMay 28, 2021
add shortcut to executor
1 parent ad32c7b commit cefa92f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/Execution/Executor.php

+4
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ private function doesFragmentConditionMatch(ExecutionContext $executionContext,
204204
*/
205205
private function shouldIncludeNode(ExecutionContext $executionContext, $node): bool
206206
{
207+
// skip check for directives if no directives wanted
208+
if(empty($node["directives"]))
209+
return true;
210+
207211
// check if skip directive is active
208212
$skip = Values::getDirectiveValues(
209213
new GraphQLSkipDirective(),

‎src/Execution/Values.php

-4
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ public static function coerceVariableValues(Schema $schema, array $variableDefin
9696
*/
9797
public static function getDirectiveValues(GraphQLDirective $directiveDef, $node, $variableValues): ?array
9898
{
99-
// skip check for directives if no directives wanted
100-
if(empty($node["directives"]))
101-
return null;
102-
10399
$directiveNode = array_filter($node["directives"], function ($directive) use ($directiveDef) {
104100
return $directive["name"]["value"] == $directiveDef->getName();
105101
})[0] ?? null;

0 commit comments

Comments
 (0)