summaryrefslogtreecommitdiff
path: root/app/graphql/types/packages/package_links_type.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/types/packages/package_links_type.rb')
-rw-r--r--app/graphql/types/packages/package_links_type.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/graphql/types/packages/package_links_type.rb b/app/graphql/types/packages/package_links_type.rb
new file mode 100644
index 00000000000..f16937530b9
--- /dev/null
+++ b/app/graphql/types/packages/package_links_type.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Types
+ module Packages
+ class PackageLinksType < BaseObject
+ graphql_name 'PackageLinks'
+ description 'Represents links to perform actions on the package'
+ authorize :read_package
+
+ include ::Routing::PackagesHelper
+
+ field :web_path, GraphQL::Types::String, null: true, description: 'Path to the package details page.'
+
+ def web_path
+ package_path(object)
+ end
+ end
+ end
+end