Skip to content

Update schema migration tutorial for 12.2.0 snapshot and diff parameters - #793

Merged
ComfortablyCoding merged 2 commits into
mainfrom
chrisjennings/update-schema-migration-tutorial
Jul 30, 2026
Merged

Update schema migration tutorial for 12.2.0 snapshot and diff parameters#793
ComfortablyCoding merged 2 commits into
mainfrom
chrisjennings/update-schema-migration-tutorial

Conversation

@ChristopherJennings

@ChristopherJennings ChristopherJennings commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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

ChristopherJennings and others added 2 commits July 29, 2026 20:38
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>
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 30, 2026 1:47am

Request Review

@ChristopherJennings
ChristopherJennings marked this pull request as ready for review July 30, 2026 01:58
@ChristopherJennings
ChristopherJennings requested a review from a team as a code owner July 30, 2026 01:58
@ComfortablyCoding
ComfortablyCoding merged commit 1347663 into main Jul 30, 2026
6 checks passed
@ComfortablyCoding
ComfortablyCoding deleted the chrisjennings/update-schema-migration-tutorial branch July 30, 2026 13:48
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