Repository navigation
fix(examples/solid/offline): type the movie query and mutation with 'queryOptions' and 'mutationOptions' - #11975
Conversation
…queryOptions' and 'mutationOptions'
|
|
View your CI Pipeline Execution ↗ for commit 4c55a01
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version Preview5 package(s) bumped directly, 20 bumped as dependents. 🟩 Patch bumps
|
size-limit report 📦
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue was established. Successful movie updates retain their notification; the change is ready to merge after normal checks. Pre-merge checks |
|
🎯 Changes
Types the solid offline example without
anyor casts:movieQueryOptionsand use its taggedqueryKeyforgetQueryData/setQueryDataanduseQuery, replacing the explicitgetQueryDatageneric.updateMovieMutationOptionsand share it betweensetMutationDefaultsanduseMutation, so the variables and result types come from onemutationFn. It usescontext.clientbecausemovies.tshas noQueryClientin scope.onSuccess, wheredatais typed, and remove theanyannotations from theMutationCacheonSuccessand theuseMutationonError. The globalMutationCachekeeps the error notification.variables. PreviouslyonMutatecleared the local comment before reading it, so the optimistic update wroteundefinedand the textarea went blank after an offline submit.fetchMoviesresponse with onlyidandtitle, matching what the/movieshandler returns.POSThandler withhttp.post<Params, RequestBody>instead of castingrequest.json(), and annotateupdateMovie's response.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit
Bug Fixes
Improvements