Class: Types::SnippetType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/snippet_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


82
83
84
# File 'app/graphql/types/snippet_type.rb', line 82

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

#projectObject


86
87
88
# File 'app/graphql/types/snippet_type.rb', line 86

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