Class: LinearToonMcp::Tools::SaveComment
- Defined in:
- lib/linear_toon_mcp/tools/save_comment.rb
Overview
Create or update a comment on an issue, project, initiative, or project status update. id presence determines create vs update. On create, exactly one parent identifies what the comment is attached to.
Constant Summary collapse
- RETURN_FIELDS =
standard:enable Layout/LineLength
<<~GRAPHQL id body createdAt editedAt user { id name } issue { id identifier } project { id name } initiative { id name } projectUpdate { id } GRAPHQL
- CREATE_MUTATION =
<<~GRAPHQL mutation($input: CommentCreateInput!) { commentCreate(input: $input) { success comment { #{RETURN_FIELDS.strip} } } } GRAPHQL
- UPDATE_MUTATION =
<<~GRAPHQL mutation($id: String!, $input: CommentUpdateInput!) { commentUpdate(id: $id, input: $input) { success comment { #{RETURN_FIELDS.strip} } } } GRAPHQL
Instance Method Summary collapse
-
#perform(body:, id: nil, issue: nil, project: nil, initiative: nil, projectUpdate: nil, parentId: nil) ⇒ Object
standard:disable Naming/VariableName.
Methods inherited from Base
call, #call, error_response, success_response
Instance Method Details
#perform(body:, id: nil, issue: nil, project: nil, initiative: nil, projectUpdate: nil, parentId: nil) ⇒ Object
standard:disable Naming/VariableName
65 66 67 68 69 70 71 72 73 |
# File 'lib/linear_toon_mcp/tools/save_comment.rb', line 65 def perform(body:, id: nil, issue: nil, project: nil, initiative: nil, projectUpdate: nil, parentId: nil) if id reject_create_only_on_update(issue:, project:, initiative:, projectUpdate:, parentId:) update(id, body) else create(body:, issue:, project:, initiative:, projectUpdate:, parentId:) end end |