Skip to content

feature: Mutation scopes#96

Merged
k-ode merged 3 commits intomainfrom
feature/mutation-scopes
Jan 5, 2026
Merged

feature: Mutation scopes#96
k-ode merged 3 commits intomainfrom
feature/mutation-scopes

Conversation

@k-ode
Copy link
Contributor

@k-ode k-ode commented Jan 5, 2026

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces mutation scopes, a new feature that allows controlling whether mutations with the same scope execute sequentially or in parallel. Mutations with the same scope ID will execute sequentially (waiting for the previous one to complete), while mutations with different scope IDs run in parallel.

Key changes:

  • Added MutationScope type with an id field to identify mutation scopes
  • Implemented scope-based queuing mechanism in MstQueryHandler that chains promises for sequential execution
  • Added comprehensive tests demonstrating both sequential (same scope) and parallel (different scopes) execution behavior

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/mst-query/tests/mstQuery.test.tsx Removed unnecessary parentheses in two test assertions and added two comprehensive tests verifying sequential execution with same scope and parallel execution with different scopes
packages/mst-query/tests/models/AddItemMutation.ts Modified endpoint to accept custom implementations via meta parameter for testing purposes
packages/mst-query/src/create.ts Added MutationScope type definition and scope parameter to mutation options
packages/mst-query/src/QueryClient.ts Added MutationScope type, private mutationScopes map to track active mutations per scope, and getter method
packages/mst-query/src/MstQueryHandler.ts Implemented core scope logic that queues mutations with the same scope ID sequentially while allowing different scopes to run in parallel
packages/mst-query/package.json Bumped version from 4.2.1 to 4.4.0 reflecting new feature addition
packages/mst-query/package-lock.json Updated lockfile to reflect version change
Files not reviewed (1)
  • packages/mst-query/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k-ode k-ode merged commit 5a748a3 into main Jan 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants