Skip to content

Commit

Permalink
fix: remove usage of Rails' Array.wrap
Browse files Browse the repository at this point in the history
It looks like active_support happens to be included in the tests, which is why
this succeeded in the first place. Nevertheless, we want to avoid this dependency!
Introduced in #824
  • Loading branch information
Siebe Jan committed Jul 14, 2017
1 parent fd954de commit 9b4d28c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ def validate(context)
}

context.visitor[GraphQL::Language::Nodes::Argument] << ->(node, parent) {
node_values = Array.wrap(node.value).select { |value| value.is_a? GraphQL::Language::Nodes::VariableIdentifier }
node_values = if node.value.is_a?(Array)
node.value
else
[node.value]
end
node_values = node_values.select { |value| value.is_a? GraphQL::Language::Nodes::VariableIdentifier }

return if node_values.none?

arguments = nil
Expand Down

0 comments on commit 9b4d28c

Please sign in to comment.