---
id: "packages/active-grid/api/create-resource-server-fetch-fn"
title: "Create resource server fetch fn"
description: "createResourceServerFetchFn, CreateResourceServerFetchFnConfig, ResourceServerAction: generated from the source of active-grid."
url: "/packages/active-grid/api/create-resource-server-fetch-fn"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:create-resource-server-fetch-fn"
---

# Create resource server fetch fn

Exported by `@workspace/active-grid`. Generated from the package source; part of [the index of every export](/packages/active-grid/api).

## Functions, hooks and constants

**createResourceServerFetchFn**: `<TRow>(config: CreateResourceServerFetchFnConfig<TRow>) => ServerFetchFunction<TRow>`

## Types

**CreateResourceServerFetchFnConfig**

```ts
interface CreateResourceServerFetchFnConfig<TRow> {
  serverAction: ResourceServerAction;
  viewKey: string;
  scope?: unknown | ((params: ServerFetchParams) => unknown);
  preset?: string;
  transform?: (row: unknown) => TRow;
  onError?: (message: string) => void;
  capabilities?: GridServerCapabilities;
}
```

Build a grid `ServerFetchFunction<TRow>` on top of a resource data-action.
It transmits **no authority fields** — no model, no permission, no
`include`, no `where` — only `viewKey` plus the interaction state (page,
filters, sorting, global search, optional scope/preset/groupBy) crosses the
wire. The server-defined resource view holds model, permission, `select` and
every `where` fragment; this is the only server-mode data path.

**ResourceServerAction**

```ts
type ResourceServerAction = (
  request: unknown,
) => Promise<ResourceActionResult>;
```

A resource data-action (produced by `active-resources`'
`createResourceDataAction`). It receives the neutral wire-request and
returns the neutral result. The action holds model / permission / select /
where server-side; the client sends only the view key plus interaction
state.
