Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit a24e809

Browse files
committed
Narrow scope of variable to where it is needed
1 parent 15008c8 commit a24e809

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/graphql/execution/executor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ defmodule GraphQL.Execution.Executor do
104104

105105
defp resolve_directive(context, directives, directive_name) do
106106
ast = Enum.find(directives, fn(d) -> d.name.value == Atom.to_string(directive_name) end)
107-
directive = apply(GraphQL.Type.Directives, directive_name, [])
108107
if ast do
108+
directive = apply(GraphQL.Type.Directives, directive_name, [])
109109
%{if: val} = argument_values(directive.args, ast.arguments, context.variable_values)
110110
val
111111
else

0 commit comments

Comments
 (0)