summaryrefslogtreecommitdiff
path: root/app/graphql/types/issue_type.rb
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-05-31 11:46:16 -0500
committerBrett Walker <bwalker@gitlab.com>2019-05-31 13:19:29 -0500
commit1285b0051705519488fbc7ac3bf8511864560ac9 (patch)
tree81453b674e1d3719d477573e6a13e98e0a2a4b5e /app/graphql/types/issue_type.rb
parentb9798c157ac5973e9dd2b7ad95267014034a219f (diff)
downloadgitlab-ce-1285b0051705519488fbc7ac3bf8511864560ac9.tar.gz
Added common fields to the IssueType10795-add-epic-tree-BE-epic-graphql-support
and allow passing of child_complexity to the 'resolver_complexity' metho
Diffstat (limited to 'app/graphql/types/issue_type.rb')
-rw-r--r--app/graphql/types/issue_type.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb
index b21a226d07f..dd5133189dc 100644
--- a/app/graphql/types/issue_type.rb
+++ b/app/graphql/types/issue_type.rb
@@ -15,6 +15,10 @@ module Types
field :description, GraphQL::STRING_TYPE, null: true
field :state, IssueStateEnum, null: false
+ field :reference, GraphQL::STRING_TYPE, null: false, method: :to_reference do
+ argument :full, GraphQL::BOOLEAN_TYPE, required: false, default_value: false
+ end
+
field :author, Types::UserType,
null: false,
resolve: -> (obj, _args, _ctx) { Gitlab::Graphql::Loaders::BatchModelLoader.new(User, obj.author_id).find }
@@ -37,7 +41,9 @@ module Types
field :upvotes, GraphQL::INT_TYPE, null: false
field :downvotes, GraphQL::INT_TYPE, null: false
field :user_notes_count, GraphQL::INT_TYPE, null: false
+ field :web_path, GraphQL::STRING_TYPE, null: false, method: :issue_path
field :web_url, GraphQL::STRING_TYPE, null: false
+ field :relative_position, GraphQL::INT_TYPE, null: true
field :closed_at, Types::TimeType, null: true