- π€Έπ½ββοΈ One lightweight package to manage REST and GraphQL APIs or any other kind of API
- π© Fully customizable behavior by creating your own cache store and query key implementations
- Β± Request deduplication by query key
- π’ Synchronize all instances of Qweries which share query keys
- ποΈ Normalized and document caches available
- π§ Sourcemaps for easy debugging
- βοΈβπ₯ Decouple data fetching logic from the type of API or frontend framework
- βοΈ Simple public APIs
- π CJS + ESM
qwery
is a collection of lightweight composable hooks and helpers to aid with async state management. It was designed with the aim of simplifying architectural migrations to support building evolutionary architectures in mind.
π For more information, check out the wiki.
- Normalized and document caching + structural sharing + query cancellation + automatic garbage collection + subscriptions/polling + suspense + refetching + mutations + broadcast updates + SSR = Any place β
- Backend agnostic + client side transactions + retry mechanism + batching = Any time β
- React + Vue + Solid + Svelte = Anywhere β
After a few bumpy 1.x.x and 2.0.x releases π¬, v2.1.x onwards are considered stable
qwery
heavily draws upon ideas from:
misc:
- urql: really nice README
- apollo-client: GraphQL document transforms
Contributions are welcome, just make a pull request.
Most of the core logic is within shared
, have avoided creating an abstract core class which requires a rerender
specific to each framework because the differences between each framework make this not worth the while I think because then effort shifts towards reconciliation, for example:
- with React we trigger a rerender by updating a counter
- with Solid (and other signal based frameworks) we trigger a rerender by updating the
qwery
signal
to extract out the core into a general purpose class would be introducing data
, version
and dispatch
signals and then updating each of these individually.
Another one is that supporting both suspense and non suspense:
- in React we throw a Promise before proceeding
- in Solid, we
createResource
- in Svelte, there is no suspense and we just return the async
- in Vue, we just make the component async
"Man's duality, life and its formalities"