-
Notifications
You must be signed in to change notification settings - Fork 115
Make clear in mutation doc that using other ways of writing to backend is ok #750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make clear in mutation doc that using other ways of writing to backend is ok #750
Conversation
Users can completely bypass the TanStack DB mutation system and use their existing mutation logic by calling backend APIs directly and either waiting for sync or manually refetching collections.
- Clarify this is about not rewriting existing logic, not avoiding optimistic updates - Add Electric's awaitTxId as a sync option - Show collection-specific approaches (QueryCollection refetch vs Electric awaitTxId) - Provide examples for both patterns
|
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: 0 B Total Size: 77.6 kB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 2.89 kB ℹ️ View Unchanged
|
Present bypassing the mutation system as one of several valid approaches rather than an aggressive callout. Fits more naturally as the first option under Mutation Approaches.
Present TanStack DB's mutation approaches first, with bypassing the mutation system as the final option for those who prefer their existing patterns.
Manual transactions is niche and covered in detail later in its own section. Keep Mutation Approaches focused on the main patterns.
Explain that awaiting refetch/sync lets you know when the server change is loaded in the collection, so you can render new data, hide loading indicators, navigate, etc.
Include showing success messages as a common reason to await sync completion, alongside rendering data, hiding loaders, and navigating.
Clarify that you write to the server like normal, then use your collection's mechanism to await the server write and know when to update UI.
Address feedback from user who thought they had to use DB's built-in mutations system.