2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
module Resolvers
|
|
|
|
module FullPathResolver
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
prepended do
|
|
|
|
argument :full_path, GraphQL::ID_TYPE,
|
|
|
|
required: true,
|
2021-03-08 18:12:59 +05:30
|
|
|
description: 'The full path of the project, group or namespace, e.g., "gitlab-org/gitlab-foss".'
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def model_by_full_path(model, full_path)
|
2020-06-23 00:09:42 +05:30
|
|
|
::Gitlab::Graphql::Loaders::FullPathModelLoader.new(model, full_path).find
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|