Update schema migration tutorial for 12.2.0 snapshot and diff parameters - #793
Merged
ComfortablyCoding merged 2 commits intoJul 30, 2026
Merged
Conversation
The REST API tab told readers to POST the snapshot response body to /schema/apply. That endpoint consumes the diff, not the snapshot: api/src/controllers/schema.ts types the apply body as SnapshotDiffWithHash and passes it to service.apply(). Following the tutorial as written fails. The Node.js tab on the same page already did this correctly with schemaApply(diff), so the two tabs contradicted each other. Pre-existing error, unrelated to any specific release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Verified against the v12.2.0 tag. - Partial snapshots via includeCollections/excludeCollections (api/src/controllers/schema.ts rejects both together; resolve-scoped-collections.ts filters strictly and ignores unknown names, so it does not pull in related collections). A scoped snapshot is marked version 2, and get-snapshot-diff.ts reads that marker to scope the diff, so applying a partial snapshot never removes collections left out of it - The diff mode parameter: mirror is the default, merge omits operations that would delete a collection, field, or relation - schemaDiff now takes an options object. v12.1.1 accepted force as a positional boolean, so the previous instruction to pass force as a second argument no longer works Also drops a stale sentence claiming getSnapshot() destructures a data property, which the surrounding code does not do. It sat where the new snapshot prose goes, so it could not be separated out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ChristopherJennings
marked this pull request as ready for review
July 30, 2026 01:58
ComfortablyCoding
approved these changes
Jul 30, 2026
ComfortablyCoding
deleted the
chrisjennings/update-schema-migration-tutorial
branch
July 30, 2026 13:48
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.
One step looks like it could be wrong: the last instruction tells readers to send the wrong data, so following the REST version would fail. That appears to predate 12.2.0.
One code example seemed to need updating, because the way an option is passed to the SDK seems to have changed, which would make the old instruction stop working.
Is this an accurate update of what these changes actually do? This is based on the source rather than the release notes, so the details or the emphasis could be off.
Merge before or together with #792