Class: Types::EventType

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

Instance Method Summary collapse

Methods inherited from BaseObject

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

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#authorObject



40
41
42
# File 'app/graphql/types/event_type.rb', line 40

def author
  Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
end

#projectObject



44
45
46
# File 'app/graphql/types/event_type.rb', line 44

def project
  Gitlab::Graphql::Loaders::BatchModelLoader.new(Project, object.project_id).find
end

#targetObject



48
49
50
51
52
53
# File 'app/graphql/types/event_type.rb', line 48

def target
  # If we don't have target info, bail
  return unless object.target_type && object.target_id

  Gitlab::Graphql::Loaders::BatchModelLoader.new(target_type_class, object.target_id).find
end