module GraphQL::Execution::Interpreter::Runtime::GraphQLResult
Attributes
TODO test full path in Partial
Returns
-
Hash— Plain-Ruby result data (@graphql_metadatacontains Result wrapper objects)
Public Class Methods
# File lib/graphql/execution/interpreter/runtime/graphql_result.rb, line 9 def initialize(result_name, result_type, application_value, parent_result, is_non_null_in_parent, selections, is_eager, ast_node, graphql_arguments, graphql_field) # rubocop:disable Metrics/ParameterLists @ast_node = ast_node @graphql_arguments = graphql_arguments @graphql_field = graphql_field @graphql_parent = parent_result @graphql_application_value = application_value @graphql_result_type = result_type if parent_result && parent_result.graphql_dead @graphql_dead = true end @graphql_result_name = result_name @graphql_is_non_null_in_parent = is_non_null_in_parent # Jump through some hoops to avoid creating this duplicate storage if at all possible. @graphql_metadata = nil @graphql_selections = selections @graphql_is_eager = is_eager @base_path = nil end
Public Instance Methods
Source
# File lib/graphql/execution/interpreter/runtime/graphql_result.rb, line 35 def build_path(path_array) graphql_result_name && path_array.unshift(graphql_result_name) if @graphql_parent @graphql_parent.build_path(path_array) elsif @base_path @base_path + path_array else path_array end end
Source
# File lib/graphql/execution/interpreter/runtime/graphql_result.rb, line 46 def depth @depth ||= if @graphql_parent @graphql_parent.depth + 1 else 1 end end
Source
# File lib/graphql/execution/interpreter/runtime/graphql_result.rb, line 31 def path @path ||= build_path([]) end