Class: LinearToonMcp::Tools::RemoveProjectFromInitiative

Inherits:
Delete
  • Object
show all
Defined in:
lib/linear_toon_mcp/tools/remove_project_from_initiative.rb

Overview

Unlink a project from an initiative. Accepts names or UUIDs for both; resolves them through Resolvers::Initiative and Resolvers::Project, finds the matching join record id, then submits initiativeToProjectDelete.

Constant Summary collapse

MUTATION =
<<~GRAPHQL
  mutation($id: String!) {
    initiativeToProjectDelete(id: $id) { success entityId }
  }
GRAPHQL
<<~GRAPHQL
  query($projectId: String!) {
    project(id: $projectId) {
      initiativeToProjects { nodes { id initiative { id } } }
    }
  }
GRAPHQL

Instance Method Summary collapse

Methods inherited from Delete

entity, entity_label, entity_name, label, mutation, mutation_name, mutation_string, #perform

Methods inherited from Base

call, #call, error_response, #perform, success_response

Instance Method Details

#variables(initiative:, project:) ⇒ Object



45
46
47
48
49
# File 'lib/linear_toon_mcp/tools/remove_project_from_initiative.rb', line 45

def variables(initiative:, project:)
  initiative_id = Resolvers::Initiative.call(value: initiative)
  project_id = Resolvers::Project.call(value: project)
  {id: lookup_join_id(initiative_id, project_id, initiative, project)}
end