{"id":16969372,"url":"https://github.com/webmasterdevlin/react-query-v2","last_synced_at":"2025-10-16T08:45:34.528Z","repository":{"id":102789230,"uuid":"345307947","full_name":"webmasterdevlin/react-query-v2","owner":"webmasterdevlin","description":"Nextjs React Query version 2 demo","archived":false,"fork":false,"pushed_at":"2021-03-09T08:24:39.000Z","size":81,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T13:41:55.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterdevlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-07T09:40:07.000Z","updated_at":"2021-03-09T08:24:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a5bd3d0-a365-4cf9-b464-618032a8201e","html_url":"https://github.com/webmasterdevlin/react-query-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Freact-query-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Freact-query-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Freact-query-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Freact-query-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterdevlin","download_url":"https://codeload.github.com/webmasterdevlin/react-query-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244852322,"owners_count":20521151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:24:57.216Z","updated_at":"2025-10-16T08:45:34.434Z","avatar_url":"https://github.com/webmasterdevlin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## What is this?\n\nIt's an example repo that show show to go from a simple hook-based application to React Query, avoiding all of the \"global state\" madness that normally happens!\n\n- The `main` branch contains the initial code we started with\n- The `with-react-query` branch contains the code we ended with after adding `react-query`\n- The #2 PR currently open in the repo shows the changes between the two\n\n## Challenges\n\n- Convert the custom hooks used to fetch data to use `useQuery`\n- Implement per-screen background fetching indicators\n- Convert the custom hooks used to create/update/delete to use `useMutation`\n- Configure mutations to automatically invalidate related queries\n- Implement optimistic updates for mutations\n- Prefetch individual posts on hover using `queryCache.prefetchQuery` OR\n- Use `initialData` to show placeholder content for individual posts that pull from the parent `posts` query\n- Remove per-screen background fetching indicators and instead build a global refetching indicator\n- Dehydrate/hydrate the cache to and from localStorage using the `react-query/hydration` APIs\n\n## How do I develop on this?\n\n- Run `yarn` and then `yarn dev` locally.\n- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.\n- **NOTE:** The \"database\" used in this app is simply a JSON file and thus will not work as a deployed application. That said, you are more than welcome to hook it up to a real API if you want!\n\n## Why Next.js?\n\n[Read This 😁](https://gist.github.com/tannerlinsley/65ac1f0175d79d19762cf06650707830)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Freact-query-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterdevlin%2Freact-query-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Freact-query-v2/lists"}