lib/graphql/language/nodes.rb in graphql-2.0.20 vs lib/graphql/language/nodes.rb in graphql-2.0.21
- old
+ new
@@ -1,10 +1,10 @@
# frozen_string_literal: true
module GraphQL
module Language
module Nodes
- NONE = [].freeze
+ NONE = GraphQL::EmptyObjects::EMPTY_ARRAY
# {AbstractNode} is the base class for all nodes in a GraphQL AST.
#
# It provides some APIs for working with ASTs:
# - `children` returns all AST nodes attached to this one. Used for tree traversal.
# - `scalars` returns all scalar (Ruby) values attached to this one. Used for comparing nodes.
@@ -49,10 +49,10 @@
other.kind_of?(self.class) &&
other.scalars == self.scalars &&
other.children == self.children
end
- NO_CHILDREN = [].freeze
+ NO_CHILDREN = GraphQL::EmptyObjects::EMPTY_ARRAY
# @return [Array<GraphQL::Language::Nodes::AbstractNode>] all nodes in the tree below this one
def children
NO_CHILDREN
end