Skip to content

document update --content and --content-file fail with Internal server error #153

Description

@schpet

linear document update fails when passing content, but works for title-only updates.

Reproduction

# Works
linear doc update abc123 --title "New Title"

# Fails — inline content
linear doc update abc123 --content "# Test heading"
# ✗ Failed to update document: Internal server error

# Fails — content from file
echo "# Test heading" > /tmp/test.md
linear doc update abc123 --content-file /tmp/test.md
# ✗ Failed to update document: Internal server error

The equivalent GraphQL mutation works fine via linear api:

linear api "$(< query.graphql)" \
  --variable 'id=aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' \
  --variable 'content=@/tmp/test.md'

where query.graphql is:

mutation($id: String!, $content: String!) {
  documentUpdate(id: $id, input: { content: $content }) {
    success
  }
}

Side note: linear api escapes ! in query strings

Passing the query inline also breaks because ! gets backslash-escaped before being sent:

linear api 'mutation($id: String!, $content: String!) { ... }'
# Syntax Error: Unexpected character: "\".
# 1 | mutation($id: String\!, $content: String\!) { ...

Workaround is reading the query from a file via shell substitution ($(< file)).

Environment

  • linear-cli 1.10.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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