feat: atomic relationship updates in updateBean#81
Merged
hmans merged 2 commits intohmans:mainfrom Feb 7, 2026
Merged
Conversation
2639f12 to
beefb15
Compare
- Added parent, addBlocking, removeBlocking, addBlockedBy, removeBlockedBy fields to UpdateBeanInput - Enables atomic updates of relationships alongside metadata and body changes - Updated CLI to use atomic relationship updates instead of separate mutations - Added comprehensive test coverage for relationship updates - Added ETag validation tests for all GraphQL mutations This resolves the limitation where updating relationships required separate mutations, making multi-field updates non-atomic and more complex for clients.
- Added addTags and removeTags fields to UpdateBeanInput - Made tags consistent with relationship fields (granular add/remove) - Updated CLI to use addTags/removeTags instead of client-side merging - Added mutual exclusivity validation between tags and addTags/removeTags - Added 4 comprehensive tests for tag operations - All tests passing This resolves the API inconsistency where: - Tags used full replacement (fetch-modify-update required) - Relationships used granular add/remove (simpler for AI agents) Now both follow the same pattern for a cleaner mental model.
beefb15 to
bbc7412
Compare
hmans
reviewed
Feb 7, 2026
Owner
hmans
left a comment
There was a problem hiding this comment.
A useful change, and thanks for including the still new-ish blocked-by relationships right away.
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.
Motivation
Depends on: #72
PR #72 added atomic body modifications via the
bodyModfield inupdateBean. This PR extends the same pattern to relationship fields (parent, blocking, blockedBy).Currently, updating relationships requires separate mutations with manual ETag extraction:
This PR consolidates relationship management into `updateBean` for truly atomic operations.
Changes
GraphQL API Improvements
Added relationship fields to `UpdateBeanInput`:
New capabilities:
Implementation Details
Extracted validation helpers to `resolver.go`:
Updated `updateBean` resolver:
Updated CLI (`cmd/update.go`):
Backward Compatibility
Standalone relationship mutations remain available:
No breaking changes. The new fields in `updateBean` are purely additive.
Examples
CLI - Combined operations:
GraphQL - Atomic update:
Before (multiple mutations with ETag chaining):
After (single atomic mutation):
Execution Order
Validations
All existing validations preserved:
Parent validation:
Blocking/Blocked-by validation:
Testing
Unit tests added:
Manual testing:
All tests passing ✅ (42 graph tests total)
Benefits
Questions for Consideration
Should we deprecate and remove standalone relationship mutations?
Following the same reasoning as in #72 (where we removed `replaceInBody` and `appendToBody`), we could deprecate the standalone relationship mutations to:
Affected mutations:
Migration would be straightforward:
Alternatively, we could keep both approaches available if there's value in having specialized mutations for specific use cases.
What's your preference?