debian-mirror-gitlab/app/graphql/resolvers/full_path_resolver.rb
2021-10-27 15:23:28 +05:30

17 lines
473 B
Ruby

# frozen_string_literal: true
module Resolvers
module FullPathResolver
extend ActiveSupport::Concern
prepended do
argument :full_path, GraphQL::Types::ID,
required: true,
description: 'Full path of the project, group, or namespace. For example, `gitlab-org/gitlab-foss`.'
end
def model_by_full_path(model, full_path)
::Gitlab::Graphql::Loaders::FullPathModelLoader.new(model, full_path).find
end
end
end