Skip to content

Commit 8089736

Browse files
committed
skip __typename from parsing
1 parent 698e057 commit 8089736

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/activecube/graphql/parse_tree.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class ParseTree
44

55
class Element
66

7+
TYPENAME = '__typename'
8+
79
attr_reader :arguments, :ast_node, :cube, :parent, :name, :definition, :key,
810
:children, :metric, :dimension, :field, :context_node
911
def initialize cube, context_node, parent = nil
@@ -34,7 +36,9 @@ def initialize cube, context_node, parent = nil
3436
end
3537
end
3638

37-
@children = context_node.typed_children.values.map(&:values).flatten.collect do |child|
39+
@children = context_node.typed_children.values.map(&:values).flatten.
40+
select{|child| child.name!=TYPENAME}.
41+
collect do |child|
3842
Element.new cube, child, self
3943
end
4044

lib/activecube/graphql/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Activecube
22
module Graphql
3-
VERSION = "0.1.2"
3+
VERSION = "0.1.3"
44
end
55
end

0 commit comments

Comments
 (0)