Add --project to document update#248
Open
schpetbot wants to merge 1 commit into
Open
Conversation
`document create` accepts --project but `document update` did not, so a document's project attachment was fixed at creation time — changing it required the web UI. Add --project to update (UUID, slug ID, or name), reusing the same resolveProjectId path as create so resolution and errors stay consistent. The reporter framed this around Linear's web UI supporting multiple project links per document with add/remove semantics (--project X --remove). The API tells a different story: a Document has a single related project (the scalar DocumentUpdateInput.projectId), and create requires exactly one anchor — so a document always has one project and setting merely replaces it. A detach flag was prototyped, but live testing showed the API silently ignores `projectId: null` (returns success, keeps the project), so shipping it would have been a silent no-op; it was dropped rather than lie about detaching. Github-Issue: Fixes #225 Github-Issue-Url: #225
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
document createaccepts--project, butdocument updatedidn't — so a document's project attachment was fixed at creation time; changing it meant using the web UI. This adds--project <uuid|slug|name>todocument update, reusing the sameresolveProjectIdpath ascreate(consistent resolution and not-found errors).On the reporter's
--remove/ multi-link framingThe issue framed this around Linear's web UI supporting multiple project links per document with add/remove semantics (
--project X --remove). The API models it differently: aDocumenthas a single related project (the scalarDocumentUpdateInput.projectId; there's no document-links mutation), anddocument createrequires exactly one anchor — so a document always has one project and setting simply replaces it.I prototyped a
--clear-projectdetach flag, but live testing showed the API silently ignoresprojectId: null(returnssuccesswhile keeping the project). Shipping it would have been a silent no-op, so it was dropped rather than lie about detaching. Re-pointing to a different project works and is verified end-to-end.Tests
Command snapshots for set-by-UUID, set-by-name (resolution + mutation), combined
--title+--project, and project-not-found. Manually QA'd against a live workspace (create → change by UUID → change by name → confirmed the API ignores clear).Fixes #225