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 document updatefails when passing content, but works for title-only updates.Reproduction
The equivalent GraphQL mutation works fine via
linear api:where
query.graphqlis:Side note:
linear apiescapes!in query stringsPassing the query inline also breaks because
!gets backslash-escaped before being sent:Workaround is reading the query from a file via shell substitution (
$(< file)).Environment