Class: Types::Notes::NoteType

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

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

#authorObject


65
66
67
# File 'app/graphql/types/notes/note_type.rb', line 65

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

#projectObject


61
62
63
# File 'app/graphql/types/notes/note_type.rb', line 61

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

#system_note_icon_nameObject


57
58
59
# File 'app/graphql/types/notes/note_type.rb', line 57

def system_note_icon_name
  SystemNoteHelper.system_note_icon_name(object) if object.system?
end

#urlObject


53
54
55
# File 'app/graphql/types/notes/note_type.rb', line 53

def url
  ::Gitlab::UrlBuilder.build(object)
end