Class: GraphQL::Analyzer::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/analyzer/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, explained_queries) ⇒ Result

Returns a new instance of Result.



8
9
10
11
# File 'lib/graphql/analyzer/result.rb', line 8

def initialize(root, explained_queries)
  @root = root
  @explained_queries = explained_queries
end

Instance Attribute Details

#explained_queriesObject (readonly) Also known as: queries

Returns the value of attribute explained_queries.



5
6
7
# File 'lib/graphql/analyzer/result.rb', line 5

def explained_queries
  @explained_queries
end

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/graphql/analyzer/result.rb', line 4

def path
  @path
end

#rootObject (readonly)

Returns the value of attribute root.



5
6
7
# File 'lib/graphql/analyzer/result.rb', line 5

def root
  @root
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
# File 'lib/graphql/analyzer/result.rb', line 13

def to_h
  {
    query: root,
    details: explained_queries,
    path: path
  }
end