Class: Types::NestedEnvironmentType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/nested_environment_type.rb

Overview

rubocop: disable Graphql/AuthorizeTypes

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#environmentObject



19
20
21
22
23
24
25
# File 'app/graphql/types/nested_environment_type.rb', line 19

def environment
  BatchLoader::GraphQL.for(object.last_id).batch do |environment_ids, loader|
    Environment.id_in(environment_ids).each do |environment|
      loader.call(environment.id, environment)
    end
  end
end