Skip to content

feat(docs): add DataStore migration guide with Apollo Client patterns#8540

Draft
ahmedhamouda78 wants to merge 3 commits intoaws-amplify:mainfrom
ahmedhamouda78:docs/datastore-investigation
Draft

feat(docs): add DataStore migration guide with Apollo Client patterns#8540
ahmedhamouda78 wants to merge 3 commits intoaws-amplify:mainfrom
ahmedhamouda78:docs/datastore-investigation

Conversation

@ahmedhamouda78
Copy link
Copy Markdown
Member

@ahmedhamouda78 ahmedhamouda78 commented Apr 1, 2026

Description of changes:

Adds a comprehensive migration guide for Gen 1 developers who want to replace DataStore with Apollo Client while keeping their Gen 1 backend. The guide covers three strategies based on application needs:

  • API Only — direct GraphQL queries/mutations via Apollo Client, recommended for most apps
  • Local Caching — persistent cache with optimistic updates via apollo3-cache-persist
  • Offline-First — full offline architecture with Dexie.js, mutation queue, sync engine, and conflict resolution

The guide includes 8 pages: strategy decision framework, Apollo Client setup with Cognito auth, CRUD operation migration, relationship migration, local caching, offline support, and advanced patterns (composite keys, codegen, React component migration). All pages include before/after code examples mapping DataStore APIs to their Apollo Client equivalents, with platform-specific content for React, Angular, Vue, Next.js, React Native, and vanilla JS.

Related GitHub issue #, if available:

Instructions

Which product(s) are affected by this PR (if applicable)?

  • amplify-cli
  • amplify-ui
  • amplify-studio
  • amplify-hosting
  • amplify-libraries

Which platform(s) are affected by this PR (if applicable)?

  • JS
  • Swift
  • Android
  • Flutter
  • React Native

Checks

  • Does this PR conform to the styleguide?

  • Does this PR include filetypes other than markdown or images? Please add or update unit tests accordingly.

  • Are any files being deleted with this PR? If so, have the needed redirects been created?

  • Are all links in MDX files using the MDX link syntax rather than HTML link syntax?

When this PR is ready to merge, please check the box below

  • Ready to merge

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

- Add comprehensive migration guide index page for DataStore to Apollo Client
- Add choose-strategy guide for migration approach selection
- Add set-up-apollo guide for Apollo Client configuration
- Add migrate-crud-operations guide for query and mutation patterns
- Add migrate-relationships guide for handling data relationships
- Add add-local-caching guide for persistent cache and optimistic updates
- Add build-offline-support guide for offline-first functionality
- Add advanced-patterns guide for complex migration scenarios
- Update directory structure to include new migrate-from-datastore section with nested pages
- Provides step-by-step guidance for developers transitioning from DataStore to Apollo Client
@ahmedhamouda78 ahmedhamouda78 requested a review from a team as a code owner April 1, 2026 12:47
@ahmedhamouda78 ahmedhamouda78 added the run-tests Label to run tests on PRs from a fork label Apr 1, 2026
@ahmedhamouda78 ahmedhamouda78 force-pushed the docs/datastore-investigation branch from cafe758 to c222f63 Compare April 1, 2026 12:57
@ahmedhamouda78 ahmedhamouda78 marked this pull request as draft April 1, 2026 14:44
soberm added a commit that referenced this pull request Apr 24, 2026
…ationships, caching, and offline support

Add comprehensive migration guide pages matching the scope of PR #8540 but
with the correct approach of disabling conflict resolution first:

- choose-strategy: Decision framework and feature parity matrix
- set-up-apollo: Apollo Client installation, auth link chain, subscriptions
- migrate-crud-operations: Create, update, delete, filters, pagination, sorting
- migrate-relationships: hasMany, belongsTo, hasOne, manyToMany patterns
- add-local-caching: apollo3-cache-persist, optimistic updates, typePolicies
- build-offline-support: Dexie.js, mutation queue, sync engine, connectivity
- advanced-patterns: React component migration, composite keys, codegen

Key differences from PR #8540:
- No _version tracking (conflict resolution disabled)
- Simpler mutations (no ConditionalCheckFailedException)
- Hard deletes instead of soft deletes for new operations
- _deleted filtering only during transition period
- Simplified offline sync engine without conflict resolution
soberm added a commit that referenced this pull request Apr 24, 2026
…final step

Replaced our custom frontend migration pages with PR #8540's content,
which correctly handles _version tracking while conflict resolution is
still enabled.

Our contribution on top of PR #8540:
- Added disable-conflict-resolution page as the final backend step
- Updated index.mdx with step 5 and disable-CR checklist
- Added disable-conflict-resolution to directory.mjs (last position)
- Updated index.mdx intro to mention disabling CR as an eventual goal

The guide now follows the correct flow:
1. Migrate frontend from DataStore to Apollo (PR #8540's content)
2. Disable conflict resolution as the final backend step (our addition)
soberm added a commit that referenced this pull request Apr 24, 2026
Add Persistor, Dexie, dedup, posttags, callouts, immer, ERESOLVE
to fix spellcheck CI failures on PR #8540 content.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-tests Label to run tests on PRs from a fork

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant