Class: Types::Notes::DiscussionType
- Inherits:
-
BaseObject
- Object
- GraphQL::Schema::Object
- BaseObject
- Types::Notes::DiscussionType
- Defined in:
- app/graphql/types/notes/discussion_type.rb
Constant Summary collapse
- DiscussionID =
::Types::GlobalIDType[::Discussion]
Instance Method Summary collapse
- #noteable ⇒ Object
-
#reply_id ⇒ Object
DiscussionID.coerce_result is suitable here, but will always mark this as being a ‘Discussion’.
Methods inherited from BaseObject
accepts, assignable?, authorization, authorize, authorized?, #current_user, #id
Methods included from Gitlab::Graphql::Present
Instance Method Details
#noteable ⇒ Object
32 33 34 35 36 37 38 |
# File 'app/graphql/types/notes/discussion_type.rb', line 32 def noteable noteable = object.noteable return unless Ability.allowed?(context[:current_user], :"read_#{noteable.to_ability_name}", noteable) noteable end |
#reply_id ⇒ Object
DiscussionID.coerce_result is suitable here, but will always mark this as being a ‘Discussion’. Using ‘GlobalId.build` guarantees that we get the correct class, and that it matches `id`.
28 29 30 |
# File 'app/graphql/types/notes/discussion_type.rb', line 28 def reply_id ::Gitlab::GlobalId.build(object, id: object.reply_id) end |