Repository navigation
refactor(examples/react/rick-morty): type the API responses and share the queries with 'queryOptions' - #12068
Conversation
… the queries with 'queryOptions'
|
|
View your CI Pipeline Execution ↗ for commit d95c37d
☁️ Nx Cloud last updated this comment at |
🚀 Changeset Version PreviewNo changeset entries found. Merging this PR will not cause a version bump for any packages. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
size-limit report 📦
|
🎯 Changes
src/api.ts: addsEpisode,Character,LocationandPaginated<T>types, gives each fetch function a typed return value instead ofany, and exportsqueryOptionsfactories for the episodes, episode, characters, character and location queries. The fetch functions are no longer exported.Episodes.tsx,Episode.tsx,Characters.tsx,Character.tsx: use those factories inuseQueryinstead of inlinequeryKey/queryFn, and drop the: anyannotations on themapcallbacks, so['episode', id]and['character', id]are defined once and the data is typed.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit