TanStack Query adapter for SnapWP.
This package is a wrapper around the TanStack Query library, allowing you to use TanStack Query as the underlying Query Engine for data fetching within the SnapWP ecosystem.
Warning
🐉 There be dragons! This project is in active development and considered experimental. Some features may be incomplete, unstable, or subject to change.
-
Add the package to your SnapWP project's dependencies:
npm install @snapwp/plugin-tanstack-query --save
If you wish to use TanStack Query directly, you should also install the core TanStack Query package:
npm install @snapwp/plugin-tanstack-query @tanstack/react-query --save
-
Update your snapwp.config.ts file to use the
TanStackQueryEngine:import type { SnapWPConfig } from '@snapwp/core/config'; + import { TanStackQueryEngine } from '@snapwp/plugin-tanstack-query'; const config: SnapWPConfig = { // The rest of your SnapWP config... query: { + engine: TanStackQueryEngine, }, }; export default config;
This package is part of SnapWP's monorepo and is actively maintained by rtCamp. Packages are published to npm from the packages directory, and can be used standalone in the headless WordPress ecosystem or as part of SnapWP's framework.
Contributions are welcome and encouraged! To learn more about contributing to this package or SnapWP as a whole, please read the Contributing Guide.
For development guidelines, please refer to our Development Guide.
