gitlab-org--gitlab-foss/app/graphql/resolvers/full_path_resolver.rb

18 lines
466 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Resolvers
module FullPathResolver
extend ActiveSupport::Concern
prepended do
argument :full_path, GraphQL::ID_TYPE,
required: true,
description: 'The full path of the project, group or namespace, e.g., "gitlab-org/gitlab-foss"'
2017-08-16 09:04:41 -04:00
end
def model_by_full_path(model, full_path)
::Gitlab::Graphql::Loaders::FullPathModelLoader.new(model, full_path).find
end
2017-08-16 09:04:41 -04:00
end
end