Skip to content
Christian Foidl edited this page Apr 28, 2025 · 4 revisions

Server queries are some sort of Userland implementation of the server actions concept from React and Next.js, but taken a bit further to enable some additional features, such as parallel requests and data fetching, which is not possible or not recommended using the native server actions.

The main goal is to provide a common set of utility functions for the server-side and React hooks for the client for creating and consuming both server queries (what this module implements) and the native server actions.

This module is not a competitor to the native server actions, but rather compliments the existing server actions with functionality that is missing.

What is this for?

This library is for you if you want to do more with server actions or if you want more control and solutions like tRPC are too heavy-weight.

Key Features

  • Supports Next.js App Router
  • First-class TypeScript support
  • End-to-end type safety
  • Directly use the server-side server query / mutation in your client code, just like server actions
  • Feel right at home if already using server actions
  • Lightweight library for data fetching and data mutation
  • Ties in heavily with @tanstack/react-query for both queries and mutation
  • Supports infinite queries
Clone this wiki locally