prateek3255 / blog

Prateek's digital home and blog.
https://prateeksurana.me
MIT License
11 stars 6 forks source link

blog/mastering-data-fetching-with-react-query-and-next-js/ #35

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Mastering data fetching with React Query and Next.js

Learn how React Query simplifies data fetching and caching for you and how it works in tandem with the Next.js pre-rendering methods

https://prateeksurana.me/blog/mastering-data-fetching-with-react-query-and-next-js/

KODISHALA commented 2 years ago

Thanks Prateek. Its very helpful article on React Query. I have one question here. I am building a school administration application. Where I have 3 separate backend APIs, for students data, teachers data, student reports data. In the student reports API, it returns all marks details along with studend ID and teacher ID. I need to display all students reports details as a list in the frontend screen. For each list item, I need to display student name and teacher name also. But these details are available from student API and Teacher API. So, wanted to ask you if it is possible to call the students API and Teachers API using React Query as soon as the user logs in, then storing them in a cache and fetching these details while building the reports list for the student name and teacher name using the IDs given in the student report API response. Is this is a good approach or do you foresee any performance issues? Thanks

sajjadalidev commented 2 years ago

Amazing Explanation! Well job man

itminhnhut commented 1 year ago

if i use an api update detail id then getStaticProps doesn't update the data right?

ryeong928 commented 1 year ago

Thank you for your work on posting this! it's really informative