139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
# File 'lib/graphiti/hash_renderer.rb', line 139
def render(options)
serializers = options[:data]
opts = options.slice(:fields, :include)
opts[:graphql] = @graphql
top_level_key = get_top_level_key(@resource, serializers.is_a?(Array))
hash = {top_level_key => {}}
nodes = get_nodes(serializers, opts)
add_nodes(hash, top_level_key, options, nodes, @graphql)
add_stats(hash, top_level_key, options, @graphql)
if @graphql
add_page_info(hash, serializers, top_level_key, options)
end
hash
end
|