Skip to content

This project is a demonstration of how to use React Query library to perform various front-end API requests.

Notifications You must be signed in to change notification settings

sitepoint-editors/react-query-demo

 
 

Repository files navigation

React Query Example

This project is a demonstration of how to use React Query library to perform the following frontend API requests:

  • Basic query
  • Paginated query
  • Infinite query
  • Create, Update and Delete requests

This demo project is setup with:

I've written a breakdown article for this project which is available on Sitepoint.

Run Locally

Clone the project

git clone git@github.com:sitepoint-editors/react-query-demo.git

Go to the project directory

cd react-query-demo

Install dependencies

npm install

Setup database file

cp api/sample.db.json api/db.json

Start the json-server

npm run json-server

Launch another terminal and start the Vite server

npm run dev

Head over to your browser and open the URL http://localhost:3000 to access the application.

License

MIT License

Copyright (c) 2021 SitePoint

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

This project is a demonstration of how to use React Query library to perform various front-end API requests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.0%
  • CSS 6.3%
  • HTML 1.7%