Skip to content

Feature: Add raw GraphQL query command #31

@g-click-trade

Description

@g-click-trade

Issue co-written with dear assistant Claude Code 🤖

Feature Request

Add a linearis graphql command that allows users to execute custom GraphQL queries directly against the Linear API.

Motivation

  1. Workarounds: Users can work around missing CLI features immediately
  2. Community solutions: Workarounds shared in GitHub issues help identify demand and inform implementation
  3. Power users: Advanced users get full API access without leaving the CLI
  4. Exploration: Easier to explore the API and prototype before requesting features

Proposed Solution

# Inline query
linearis graphql '{ viewer { id name email } }'

# From file
linearis graphql --file query.graphql

# With variables
linearis graphql --file query.graphql --vars '{"id": "issue-uuid"}'

# Or via stdin
echo '{ viewer { id name } }' | linearis graphql

Example Use Cases

# Get estimate (not currently exposed)
linearis graphql '{ issue(id: "uuid") { estimate } }'

# Get relations (not currently exposed)
linearis graphql '{ issue(id: "uuid") { relations { nodes { type relatedIssue { identifier } } } } }'

# Get attachments (not currently exposed)  
linearis graphql '{ issue(id: "uuid") { attachments { nodes { url title } } } }'

# Set estimate via mutation
linearis graphql 'mutation { issueUpdate(id: "uuid", input: { estimate: 5 }) { success } }'

Benefits

  • Users unblocked immediately for missing features
  • Shared workarounds in issues become documentation
  • Reduces pressure to implement every edge case
  • Aligns with Linear's own GraphQL-first approach

Reference

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions