Skip to Content
Effetch Query

Installation

Add Effetch Query to a project, with Effetch, Effect and React.

This page shows how to install Effetch Query and the packages it works with. After it, you can define your first query.

Before you begin

You need:

  • effect 4.1 or later, which is a peer dependency;
  • an ESM project, since the package is ESM only;
  • one of the supported runtimes: browsers, React Native (Hermes), Node 20 or later, Bun or Deno.

Install the package

To install Effetch Query with Effetch and Effect, run the following command:

pnpm add @monarcode/effetch-query @monarcode/effetch effect

With Effetch, Effetch Query needs Effetch 0.1.0-rc.4 or later in 0.1, which you import as import { Fetch } from "@monarcode/effetch". Effetch is optional: see the README's Without Effetch to use any Effect instead.

Add React

For React, add @effect/atom-react and react (19):

pnpm add @effect/atom-react react

Import the entry points

Each entry point is a subpath of the one package. Import only the ones you use:

Entry pointWhat it has
@monarcode/effetch-queryThe core, with no framework in it: Query, Mutation, QueryClient and the other namespaces.
@monarcode/effetch-query/reactThe provider, the hooks and the boundaries.
@monarcode/effetch-query/effetchfromClient, which turns Effetch endpoints into queries and mutations.
@monarcode/effetch-query/react-nativereactNativeSignals, from React Native modules you pass in.
@monarcode/effetch-query/react/tanstack-routerconnectQueryClient, which connects a client to TanStack Router and Start.

The core entry point exports namespaces:

import { Mutation, Query, QueryClient } from "@monarcode/effetch-query";

What's next

On this page