Skip to content

linearis milestone create fails #223

@cjveo

Description

@cjveo

What happened?

linearis milestones create always fails with a GraphQL variable error, and linearis milestones update silently sends incorrect variables. The root cause is that graphql/mutations/project-milestones.graphql declares top-level scalar variables, but src/services/milestone-service.ts passes them wrapped as { input } — every other create/update mutation in the codebase uses the $input convention, so milestone-service.ts is correct and the .graphql file is the odd one out.

Expected behavior

linearis milestones create --project <uuid> "My Milestone" creates the milestone and returns the created object as JSON. linearis milestones update <ms-id> --name "new name" updates only the fields that were provided.

Steps to reproduce

linearis milestones create "My Milestone" --project <project-uuid>

Actual output

After `npm run generate`, the existing `client.request(CreateProjectMilestoneDocument, { input })` in `milestone-service.ts` becomes type-correct end-to-end, matching `createProject`, `createInitiative`, etc.

Suggested test addition (mirrors the `listMilestones` variable assertions):


it("passes input as a top-level GraphQL variable", async () => {
  const client = mockGqlClient({
    projectMilestoneCreate: {
      success: true,
      projectMilestone: { id: "ms-new", name: "v2.0", description: null, targetDate: null, sortOrder: 0 },
    },
  });
  const input = { projectId: "proj-1", name: "v2.0", description: "desc", targetDate: "2025-12-01" };
  await createMilestone(client, input);
  expect(client.request).toHaveBeenCalledWith(expect.anything(), { input });
});

Linearis version

2026.4.9

Node.js version

v22.22.2

Operating system

Linux

Authentication method

~/.linearis/token (linearis auth login)

Additional context

graphql/mutations/project-milestones.graphql is the only mutation file in the repo that declares top-level scalar variables rather than the $input: <Type>Input! shape used everywhere else. But src/services/milestone-service.ts calls the document with { input } — which is the convention every other service uses (createProject, createInitiative, createIssue, …):

Suggest: Align project-milestones.graphql with the rest of the codebase by taking a single $input argument.

# graphql/mutations/project-milestones.graphql (proposed)
mutation CreateProjectMilestone($input: ProjectMilestoneCreateInput!) {
  projectMilestoneCreate(input: $input) {
    success
    projectMilestone { ... }
  }
}

mutation UpdateProjectMilestone(
  $id: String!
  $input: ProjectMilestoneUpdateInput!
) {
  projectMilestoneUpdate(id: $id, input: $input) {
    success
    projectMilestone { ... }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions