Skip to content

Commit

Permalink
skip __typename from parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
astudnev committed Mar 4, 2020
1 parent 698e057 commit 8089736
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/activecube/graphql/parse_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class ParseTree

class Element

TYPENAME = '__typename'

attr_reader :arguments, :ast_node, :cube, :parent, :name, :definition, :key,
:children, :metric, :dimension, :field, :context_node
def initialize cube, context_node, parent = nil
Expand Down Expand Up @@ -34,7 +36,9 @@ def initialize cube, context_node, parent = nil
end
end

@children = context_node.typed_children.values.map(&:values).flatten.collect do |child|
@children = context_node.typed_children.values.map(&:values).flatten.
select{|child| child.name!=TYPENAME}.
collect do |child|
Element.new cube, child, self
end

Expand Down
2 changes: 1 addition & 1 deletion lib/activecube/graphql/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Activecube
module Graphql
VERSION = "0.1.2"
VERSION = "0.1.3"
end
end

0 comments on commit 8089736

Please sign in to comment.