@nkzw/fate 1.5.2 → 1.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -168
- package/docs/api/classes/FateClient.md +35 -35
- package/docs/api/functions/clientRoot.md +1 -1
- package/docs/api/functions/createClient.md +1 -1
- package/docs/api/functions/createGraphQLTransport.md +1 -1
- package/docs/api/functions/createHTTPTransport.md +1 -1
- package/docs/api/functions/createTRPCTransport.md +1 -1
- package/docs/api/functions/defer.md +1 -1
- package/docs/api/functions/getDeferredMetadata.md +1 -1
- package/docs/api/functions/getListEntries.md +1 -1
- package/docs/api/functions/getSelectionPlan.md +1 -1
- package/docs/api/functions/graphqlMutation.md +1 -1
- package/docs/api/functions/isDeferred.md +1 -1
- package/docs/api/functions/isRecord.md +1 -1
- package/docs/api/functions/isViewTag.md +1 -1
- package/docs/api/functions/liveConnectionTopic.md +1 -1
- package/docs/api/functions/liveEntityTopic.md +1 -1
- package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/toEntityId.md +1 -1
- package/docs/api/functions/view.md +1 -1
- package/docs/api/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Persistence.md +1 -1
- package/docs/api/interfaces/PersistenceSession.md +9 -9
- package/docs/api/interfaces/Transport.md +8 -8
- package/docs/api/server/classes/FateRequestError.md +5 -5
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
- package/docs/api/server/functions/bindSourceProcedures.md +1 -1
- package/docs/api/server/functions/computed.md +1 -1
- package/docs/api/server/functions/count.md +1 -1
- package/docs/api/server/functions/createFateFetchHandler.md +1 -1
- package/docs/api/server/functions/createFateServer.md +1 -1
- package/docs/api/server/functions/createHonoFateHandler.md +1 -1
- package/docs/api/server/functions/createLiveEventBus.md +1 -1
- package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
- package/docs/api/server/functions/createResolver.md +1 -1
- package/docs/api/server/functions/createSourcePlan.md +1 -1
- package/docs/api/server/functions/createSourceProcedures.md +1 -1
- package/docs/api/server/functions/dataView.md +1 -1
- package/docs/api/server/functions/field.md +1 -1
- package/docs/api/server/functions/getNestedSelection.md +1 -1
- package/docs/api/server/functions/getScopedArgs.md +1 -1
- package/docs/api/server/functions/hasNestedSelection.md +1 -1
- package/docs/api/server/functions/list.md +1 -1
- package/docs/api/server/functions/refetchSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceByIds.md +1 -1
- package/docs/api/server/functions/resolveSourceConnection.md +1 -1
- package/docs/api/server/functions/resolver.md +1 -1
- package/docs/api/server/functions/toPrismaSelect.md +1 -1
- package/docs/api/server/functions/withConnection.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
- package/docs/api/server/type-aliases/ComputedField.md +5 -5
- package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
- package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
- package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
- package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
- package/docs/api/server/type-aliases/CountSelection.md +4 -4
- package/docs/api/server/type-aliases/CountWhere.md +1 -1
- package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
- package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
- package/docs/api/server/type-aliases/DataViewResult.md +1 -1
- package/docs/api/server/type-aliases/Entity.md +1 -1
- package/docs/api/server/type-aliases/FateServer.md +5 -5
- package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
- package/docs/api/server/type-aliases/FieldSelection.md +3 -3
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
- package/docs/api/server/type-aliases/LiveEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
- package/docs/api/server/type-aliases/OrderDirection.md +1 -1
- package/docs/api/server/type-aliases/SourceConfig.md +6 -6
- package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
- package/docs/api/server/type-aliases/SourceOrder.md +1 -1
- package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
- package/docs/api/server/type-aliases/SourcePlan.md +1 -1
- package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
- package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
- package/docs/api/server/type-aliases/SourceRelation.md +1 -1
- package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
- package/docs/api/server/variables/byIdInput.md +1 -1
- package/docs/api/server/variables/connectionArgs.md +1 -1
- package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Deferred.md +1 -1
- package/docs/api/type-aliases/DeferredMetadata.md +1 -1
- package/docs/api/type-aliases/DeferredSelection.md +1 -1
- package/docs/api/type-aliases/DeferredSnapshot.md +1 -1
- package/docs/api/type-aliases/Entity.md +2 -2
- package/docs/api/type-aliases/EntityId.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.md +1 -1
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
- package/docs/api/type-aliases/FateLiveEvent.md +1 -1
- package/docs/api/type-aliases/FateMutations.md +1 -1
- package/docs/api/type-aliases/FateOperation.md +1 -1
- package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
- package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
- package/docs/api/type-aliases/FateRecord.md +1 -1
- package/docs/api/type-aliases/FateRoots.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
- package/docs/api/type-aliases/GraphQLTransportOptions.md +12 -12
- package/docs/api/type-aliases/HydrateOptions.md +1 -1
- package/docs/api/type-aliases/HydrationLimits.md +1 -1
- package/docs/api/type-aliases/InferFateAPI.md +1 -1
- package/docs/api/type-aliases/List.md +1 -1
- package/docs/api/type-aliases/ListEntry.md +1 -1
- package/docs/api/type-aliases/ListItem.md +1 -1
- package/docs/api/type-aliases/Mask.md +1 -1
- package/docs/api/type-aliases/MutationDefinition.md +1 -1
- package/docs/api/type-aliases/MutationEntity.md +1 -1
- package/docs/api/type-aliases/MutationIdentifier.md +1 -1
- package/docs/api/type-aliases/MutationIdentity.md +1 -1
- package/docs/api/type-aliases/MutationInput.md +1 -1
- package/docs/api/type-aliases/MutationResult.md +1 -1
- package/docs/api/type-aliases/NodesItem.md +1 -1
- package/docs/api/type-aliases/Pagination.md +5 -5
- package/docs/api/type-aliases/PersistedMutationStatus.md +1 -1
- package/docs/api/type-aliases/PersistenceSnapshot.md +1 -1
- package/docs/api/type-aliases/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +1 -1
- package/docs/api/type-aliases/RequestPersistenceOptions.md +1 -1
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/TypeConfig.md +4 -4
- package/docs/api/type-aliases/View.md +1 -1
- package/docs/api/type-aliases/ViewData.md +1 -1
- package/docs/api/type-aliases/ViewEntity.md +1 -1
- package/docs/api/type-aliases/ViewEntityName.md +1 -1
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/type-aliases/ViewSelection.md +1 -1
- package/docs/api/type-aliases/ViewSnapshot.md +1 -1
- package/docs/api/type-aliases/ViewTag.md +1 -1
- package/docs/api/variables/ConnectionTag.md +1 -1
- package/docs/api/variables/DeferTag.md +1 -1
- package/docs/api/variables/DeferredTag.md +1 -1
- package/docs/guide/getting-started.md +1 -9
- package/docs/integrations/cloudflare.md +21 -139
- package/docs/integrations/graphql.md +2 -2
- package/docs/integrations/void.md +35 -21
- package/lib/{executor-oPTYqgQV.d.mts → executor-C3JLgeJ_.d.mts} +1 -1
- package/lib/{graphqlTransport-CGYE4NdD.d.mts → graphqlTransport-D7IPm9wQ.d.mts} +1 -1
- package/lib/graphqlTransport.d.mts +1 -1
- package/lib/{idempotency-types-DuqJ7KSd.d.mts → idempotency-types-jgGOlHFl.d.mts} +1 -1
- package/lib/idempotency.d.mts +2 -2
- package/lib/index.d.mts +4 -4
- package/lib/index.mjs +1 -1
- package/lib/{list-5hrTVoiB.d.mts → list-Dj7P-fay.d.mts} +1 -1
- package/lib/list.d.mts +1 -1
- package/lib/persistence.d.mts +1 -1
- package/lib/persistence.mjs +1 -1
- package/lib/{record-Dxjvpsep.d.mts → record-DmyMlWdZ.d.mts} +3 -3
- package/lib/server/drizzle.d.mts +2 -2
- package/lib/server/prisma.d.mts +2 -2
- package/lib/server.d.mts +3 -3
- package/lib/{store-CakBBzWG.mjs → store-Dl_OPES3.mjs} +1 -95
- package/lib/{transport-DR0fwleU.d.mts → transport-c5vvbtDC.d.mts} +4 -4
- package/lib/vite.d.mts +1 -1
- package/lib/vite.mjs +7 -27
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ _[Learn more](/docs/guide/getting-started.md) about fate's core concepts or crea
|
|
|
65
65
|
Create a new fate app with Vite+:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
vp create fate
|
|
68
|
+
vp create fate
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Explore the [fate stack](https://stack.fate.technology) to see the tools included in your new project.
|
|
@@ -128,14 +128,6 @@ yarn add @nkzw/fate
|
|
|
128
128
|
|
|
129
129
|
:::
|
|
130
130
|
|
|
131
|
-
> [!WARNING]
|
|
132
|
-
>
|
|
133
|
-
> **_fate_** is currently in alpha and not production ready. If something doesn't work for you, please open a pull request.
|
|
134
|
-
|
|
135
|
-
If you'd like to try the example app in GitHub Codespaces, click the button below:
|
|
136
|
-
|
|
137
|
-
[](https://github.com/codespaces/new?repo=nkzw-tech/fate)
|
|
138
|
-
|
|
139
131
|
## Core Concepts
|
|
140
132
|
|
|
141
133
|
**_fate_** has a minimal API surface and is aimed at reducing data fetching complexity.
|
|
@@ -1926,13 +1918,13 @@ Use the GraphQL transport when your backend already exposes GraphQL and you want
|
|
|
1926
1918
|
Create a client for an existing GraphQL server with:
|
|
1927
1919
|
|
|
1928
1920
|
```bash
|
|
1929
|
-
vp create fate
|
|
1921
|
+
vp create fate -- --template graphql-client
|
|
1930
1922
|
```
|
|
1931
1923
|
|
|
1932
1924
|
Create a full GraphQL + Prisma example app with:
|
|
1933
1925
|
|
|
1934
1926
|
```bash
|
|
1935
|
-
vp create fate
|
|
1927
|
+
vp create fate -- --template graphql
|
|
1936
1928
|
```
|
|
1937
1929
|
|
|
1938
1930
|
The client-only template is the smallest reference for the integration. It contains a `src/fate/graphql.ts` file that maps your GraphQL schema to fate views and roots.
|
|
@@ -2995,7 +2987,7 @@ _And you are all set. Happy building!_
|
|
|
2995
2987
|
|
|
2996
2988
|
## Void Integration
|
|
2997
2989
|
|
|
2998
|
-
`void-fate` is the
|
|
2990
|
+
`void-fate` is the [Void](https://void.cloud) adapter for fate. Deploy your app directly to your own Cloudflare account or to the Void platform with the same integration.
|
|
2999
2991
|
|
|
3000
2992
|
Use this integration when your app runs on Void and you want the example app's
|
|
3001
2993
|
setup without copying its adapter glue.
|
|
@@ -3005,13 +2997,13 @@ setup without copying its adapter glue.
|
|
|
3005
2997
|
For a new Void app, start from the Void template. It includes the client, Void routes, Drizzle setup, live transport, auth wiring, and generated fate client setup.
|
|
3006
2998
|
|
|
3007
2999
|
```sh
|
|
3008
|
-
vp create fate
|
|
3000
|
+
vp create fate -- --template void
|
|
3009
3001
|
```
|
|
3010
3002
|
|
|
3011
3003
|
Use Vue instead of React with:
|
|
3012
3004
|
|
|
3013
3005
|
```sh
|
|
3014
|
-
vp create fate
|
|
3006
|
+
vp create fate -- --template void --framework vue
|
|
3015
3007
|
```
|
|
3016
3008
|
|
|
3017
3009
|
### Existing Project
|
|
@@ -3122,14 +3114,29 @@ live.connection('Post.comments', { id: postId }).appendNode('Comment', commentId
|
|
|
3122
3114
|
|
|
3123
3115
|
### Routes
|
|
3124
3116
|
|
|
3117
|
+
Define a live stream once in a server-only module:
|
|
3118
|
+
|
|
3119
|
+
```ts
|
|
3120
|
+
// src/fate/live.ts
|
|
3121
|
+
import { defineLiveStream } from 'void/live';
|
|
3122
|
+
|
|
3123
|
+
export const fateStream = defineLiveStream({
|
|
3124
|
+
allowAnonymousControl: true,
|
|
3125
|
+
id: 'fate',
|
|
3126
|
+
});
|
|
3127
|
+
```
|
|
3128
|
+
|
|
3125
3129
|
Add one route for fate RPC requests:
|
|
3126
3130
|
|
|
3127
3131
|
```tsx
|
|
3128
3132
|
// routes/fate.ts
|
|
3129
3133
|
import { defineVoidFateRoute } from 'void-fate/server';
|
|
3134
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
3130
3135
|
import { fateLive, fateServer } from '../src/fate/server.ts';
|
|
3131
3136
|
|
|
3132
|
-
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive
|
|
3137
|
+
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive, {
|
|
3138
|
+
stream: fateStream,
|
|
3139
|
+
});
|
|
3133
3140
|
```
|
|
3134
3141
|
|
|
3135
3142
|
Add a second route for the live SSE transport:
|
|
@@ -3137,9 +3144,9 @@ Add a second route for the live SSE transport:
|
|
|
3137
3144
|
```tsx
|
|
3138
3145
|
// routes/fate-live.ts
|
|
3139
3146
|
import { defineVoidFateLiveRoute } from 'void-fate/server';
|
|
3140
|
-
import {
|
|
3147
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
3141
3148
|
|
|
3142
|
-
export const { GET, POST } = defineVoidFateLiveRoute(
|
|
3149
|
+
export const { GET, POST } = defineVoidFateLiveRoute(fateStream);
|
|
3143
3150
|
```
|
|
3144
3151
|
|
|
3145
3152
|
The live route handles `GET /fate-live` SSE connections and `POST /fate-live`
|
|
@@ -3205,13 +3212,7 @@ present.
|
|
|
3205
3212
|
### Custom Paths
|
|
3206
3213
|
|
|
3207
3214
|
The default route pair is `/fate` and `/fate-live`. If your Void app uses
|
|
3208
|
-
different paths,
|
|
3209
|
-
|
|
3210
|
-
```tsx
|
|
3211
|
-
export const fateLive = createVoidFateLive({
|
|
3212
|
-
livePath: '/custom-fate-live',
|
|
3213
|
-
});
|
|
3214
|
-
```
|
|
3215
|
+
different paths, update your route filenames and configure the matching client paths.
|
|
3215
3216
|
|
|
3216
3217
|
::: code-group
|
|
3217
3218
|
|
|
@@ -3247,179 +3248,66 @@ or router configuration matches the paths you pass to the client.
|
|
|
3247
3248
|
|
|
3248
3249
|
### Live Transport
|
|
3249
3250
|
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
In local development, `void-fate` uses a development token for that internal
|
|
3255
|
-
publish request. Outside local development, Void must provide `__VOID_PROXY_TOKEN`
|
|
3256
|
-
in the route environment. If no internal publish token is available, the adapter
|
|
3257
|
-
falls back to the in-memory live bus for the current request context.
|
|
3251
|
+
`createVoidFateLive` publishes entity and connection events through the `void/live`
|
|
3252
|
+
stream associated with the current request. Void manages the Durable Object
|
|
3253
|
+
transport that distributes events to connected clients across requests.
|
|
3258
3254
|
|
|
3259
3255
|
The live transport is best-effort and does not replay missed events after a
|
|
3260
3256
|
client reconnects. This matches fate's default in-memory live event bus.
|
|
3261
3257
|
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
`cf-fate` is the first-class Cloudflare Workers adapter for Fate native HTTP transport and live views.
|
|
3258
|
+
### Cloudflare Deployment
|
|
3265
3259
|
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
### New Project
|
|
3269
|
-
|
|
3270
|
-
For a new Cloudflare Workers app, start from the Cloudflare template. It includes the client, Worker server, D1 migrations, Wrangler config, Durable Object live transport, auth wiring, and generated fate client setup.
|
|
3260
|
+
From your project root, run:
|
|
3271
3261
|
|
|
3272
3262
|
```sh
|
|
3273
|
-
vp
|
|
3263
|
+
vp exec void deploy --platform cloudflare
|
|
3274
3264
|
```
|
|
3275
3265
|
|
|
3276
|
-
|
|
3266
|
+
Void provisions resources and deploys directly to your Cloudflare account. See the [Cloudflare integration](/docs/integrations/cloudflare.md) for setup and migration instructions.
|
|
3277
3267
|
|
|
3278
|
-
|
|
3279
|
-
vp create fate my-app --template cloudflare --framework vue
|
|
3280
|
-
```
|
|
3268
|
+
## Cloudflare Integration
|
|
3281
3269
|
|
|
3282
|
-
|
|
3270
|
+
Deploy fate directly to your own Cloudflare account with [Void](/docs/integrations/void.md). The Void template includes the app, D1 database, Drizzle migrations, Better Auth, and live updates through `void-fate` and `void/live`.
|
|
3283
3271
|
|
|
3284
|
-
|
|
3272
|
+
### New Project
|
|
3285
3273
|
|
|
3286
3274
|
```sh
|
|
3287
|
-
|
|
3288
|
-
|
|
3275
|
+
vp create fate -- my-app --template void
|
|
3276
|
+
cd my-app
|
|
3277
|
+
vp run dev:setup
|
|
3278
|
+
vp run dev
|
|
3289
3279
|
```
|
|
3290
3280
|
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
### Server Setup
|
|
3294
|
-
|
|
3295
|
-
Create a Cloudflare live stream and pass its Fate live facade to `createFateServer`.
|
|
3281
|
+
Add `--framework vue` to the create command to use Vue instead of React.
|
|
3296
3282
|
|
|
3297
|
-
|
|
3298
|
-
// src/fate/live.ts
|
|
3299
|
-
import { defineCloudflareFateLiveStream } from 'cf-fate/server';
|
|
3283
|
+
### Deploy
|
|
3300
3284
|
|
|
3301
|
-
|
|
3302
|
-
allowAnonymousControl: true,
|
|
3303
|
-
binding: 'FATE_LIVE',
|
|
3304
|
-
id: 'fate',
|
|
3305
|
-
});
|
|
3306
|
-
```
|
|
3285
|
+
From the project root:
|
|
3307
3286
|
|
|
3308
|
-
```
|
|
3309
|
-
|
|
3310
|
-
import { createFateServer } from '@nkzw/fate/server';
|
|
3311
|
-
import { createCloudflareFateLive } from 'cf-fate/server';
|
|
3312
|
-
|
|
3313
|
-
export const fateLive = createCloudflareFateLive();
|
|
3314
|
-
export const { live } = fateLive;
|
|
3315
|
-
|
|
3316
|
-
export const fateServer = createFateServer({
|
|
3317
|
-
live,
|
|
3318
|
-
// context,
|
|
3319
|
-
// roots,
|
|
3320
|
-
// sources,
|
|
3321
|
-
});
|
|
3322
|
-
```
|
|
3323
|
-
|
|
3324
|
-
Publish from mutations through the normal Fate live bus:
|
|
3325
|
-
|
|
3326
|
-
```ts
|
|
3327
|
-
live.update('Post', postId, { changed: ['likes'] });
|
|
3328
|
-
live.connection('Post.comments', { id: postId }).appendNode('Comment', commentId);
|
|
3329
|
-
```
|
|
3330
|
-
|
|
3331
|
-
### Worker Routes
|
|
3332
|
-
|
|
3333
|
-
Expose one route for Fate RPC and one route for the SSE live stream.
|
|
3334
|
-
|
|
3335
|
-
```ts
|
|
3336
|
-
import {
|
|
3337
|
-
createCloudflareFateLiveDurableObject,
|
|
3338
|
-
defineCloudflareFateLiveRoute,
|
|
3339
|
-
defineCloudflareFateRoute,
|
|
3340
|
-
} from 'cf-fate/server';
|
|
3341
|
-
import { fateStream } from './fate/live';
|
|
3342
|
-
import { fateLive, fateServer } from './fate/server';
|
|
3343
|
-
|
|
3344
|
-
const fateRoute = defineCloudflareFateRoute(fateServer, fateLive, { stream: fateStream });
|
|
3345
|
-
const fateLiveRoute = defineCloudflareFateLiveRoute(fateStream);
|
|
3346
|
-
|
|
3347
|
-
export const FateLiveDurableObject = createCloudflareFateLiveDurableObject({
|
|
3348
|
-
binding: 'FATE_LIVE',
|
|
3349
|
-
});
|
|
3350
|
-
|
|
3351
|
-
export default {
|
|
3352
|
-
fetch(request, env, ctx) {
|
|
3353
|
-
const url = new URL(request.url);
|
|
3354
|
-
if (url.pathname === '/fate') {
|
|
3355
|
-
return fateRoute.fetch(request, env, ctx);
|
|
3356
|
-
}
|
|
3357
|
-
if (url.pathname === '/fate-live') {
|
|
3358
|
-
return fateLiveRoute.fetch(request, env, ctx);
|
|
3359
|
-
}
|
|
3360
|
-
return new Response('Not Found', { status: 404 });
|
|
3361
|
-
},
|
|
3362
|
-
};
|
|
3363
|
-
```
|
|
3364
|
-
|
|
3365
|
-
### Wrangler
|
|
3366
|
-
|
|
3367
|
-
Add a Durable Object binding and migration. `cf-fate` uses `node:async_hooks`, so the Worker must enable Node compatibility.
|
|
3368
|
-
|
|
3369
|
-
```jsonc
|
|
3370
|
-
{
|
|
3371
|
-
"compatibility_flags": ["nodejs_compat"],
|
|
3372
|
-
"durable_objects": {
|
|
3373
|
-
"bindings": [
|
|
3374
|
-
{
|
|
3375
|
-
"name": "FATE_LIVE",
|
|
3376
|
-
"class_name": "FateLiveDurableObject",
|
|
3377
|
-
},
|
|
3378
|
-
],
|
|
3379
|
-
},
|
|
3380
|
-
"migrations": [
|
|
3381
|
-
{
|
|
3382
|
-
"tag": "fate-live-v1",
|
|
3383
|
-
"new_sqlite_classes": ["FateLiveDurableObject"],
|
|
3384
|
-
},
|
|
3385
|
-
],
|
|
3386
|
-
}
|
|
3287
|
+
```sh
|
|
3288
|
+
vp exec void deploy --platform cloudflare
|
|
3387
3289
|
```
|
|
3388
3290
|
|
|
3389
|
-
|
|
3291
|
+
Void signs you into Cloudflare when needed, lets you select your account, provisions resources, applies checked-in database migrations, and deploys the app. It saves resource IDs in the root `wrangler.jsonc`; commit that updated config for subsequent deployments. A Void platform account is not required.
|
|
3390
3292
|
|
|
3391
|
-
|
|
3293
|
+
The template includes the `VOID_LIVE` Durable Object binding and its class migration. Keep them in `wrangler.jsonc` so live subscriptions can receive updates across requests. RPC requests use `/fate`, and live updates use `/fate-live`.
|
|
3392
3294
|
|
|
3393
|
-
|
|
3394
|
-
import { fate } from 'react-fate/vite';
|
|
3295
|
+
After changing your database schema or auth configuration, run `vp run db:generate`, review and commit the generated migrations, then deploy. The migrations must include the Better Auth schema used in production.
|
|
3395
3296
|
|
|
3396
|
-
|
|
3397
|
-
module: './src/fate/server.ts',
|
|
3398
|
-
transport: 'cloudflare',
|
|
3399
|
-
});
|
|
3400
|
-
```
|
|
3401
|
-
|
|
3402
|
-
Then point the generated client at the Worker endpoints:
|
|
3403
|
-
|
|
3404
|
-
```tsx
|
|
3405
|
-
import { FateClient } from 'react-fate';
|
|
3406
|
-
import { createFateClient } from 'react-fate/client';
|
|
3297
|
+
See [Void's Cloudflare deployment guide](https://void.cloud/integrations/cloudflare) for custom domains, secrets, and CI configuration.
|
|
3407
3298
|
|
|
3408
|
-
|
|
3409
|
-
liveUrl: 'http://localhost:8787/fate-live',
|
|
3410
|
-
url: 'http://localhost:8787/fate',
|
|
3411
|
-
});
|
|
3299
|
+
### Migrating from cf-fate
|
|
3412
3300
|
|
|
3413
|
-
|
|
3414
|
-
return <FateClient client={fate}>{children}</FateClient>;
|
|
3415
|
-
}
|
|
3416
|
-
```
|
|
3301
|
+
Fate 1.6 replaces the standalone Cloudflare adapter and template with the Void integration. Use `--template void` for new projects and `transport: 'void'` in the fate Vite plugin.
|
|
3417
3302
|
|
|
3418
|
-
|
|
3303
|
+
For an existing app, move the Worker routes into Void's `routes/` directory and follow the [Void integration](/docs/integrations/void.md) for the complete setup:
|
|
3419
3304
|
|
|
3420
|
-
|
|
3305
|
+
- Define the live stream with `defineLiveStream` from `void/live`.
|
|
3306
|
+
- Use `createVoidFateLive`, `defineVoidFateRoute`, and `defineVoidFateLiveRoute` from `void-fate/server`.
|
|
3307
|
+
- Let the generated client use `void/live/client` for live connections.
|
|
3308
|
+
- Remove the `cf-fate` dependency and the custom Worker entry point.
|
|
3421
3309
|
|
|
3422
|
-
|
|
3310
|
+
Deploy the Void app as a new Worker with its `VOID_LIVE` binding and class migration. The old `FATE_LIVE` Durable Object class and its active connections are not migrated. Preserve existing database IDs and migration history when reusing your database, and reconnect clients to the new app after deployment.
|
|
3423
3311
|
|
|
3424
3312
|
## Frequently Asked Questions
|
|
3425
3313
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Class: FateClient\<Roots, Mutations, HydrationScope\>
|
|
2
2
|
|
|
3
|
-
Defined in: [fate/src/client.ts:426](https://github.com/nkzw-tech/fate/blob/
|
|
3
|
+
Defined in: [fate/src/client.ts:426](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L426)
|
|
4
4
|
|
|
5
5
|
Core client that normalizes records, manages the view cache, and coordinates
|
|
6
6
|
data fetching.
|
|
@@ -25,7 +25,7 @@ data fetching.
|
|
|
25
25
|
|
|
26
26
|
> **new FateClient**\<`Roots`, `Mutations`, `HydrationScope`\>(`options`): `FateClient`\<`Roots`, `Mutations`, `HydrationScope`\>
|
|
27
27
|
|
|
28
|
-
Defined in: [fate/src/client.ts:487](https://github.com/nkzw-tech/fate/blob/
|
|
28
|
+
Defined in: [fate/src/client.ts:487](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L487)
|
|
29
29
|
|
|
30
30
|
#### Parameters
|
|
31
31
|
|
|
@@ -43,7 +43,7 @@ Defined in: [fate/src/client.ts:487](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
43
43
|
|
|
44
44
|
> `readonly` **actions**: `MutationTreeFromRecord`\<`Mutations`\>
|
|
45
45
|
|
|
46
|
-
Defined in: [fate/src/client.ts:483](https://github.com/nkzw-tech/fate/blob/
|
|
46
|
+
Defined in: [fate/src/client.ts:483](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L483)
|
|
47
47
|
|
|
48
48
|
***
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Defined in: [fate/src/client.ts:483](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
51
51
|
|
|
52
52
|
> `readonly` **mutations**: `MutationTreeFromRecord`\<`Mutations`\>
|
|
53
53
|
|
|
54
|
-
Defined in: [fate/src/client.ts:484](https://github.com/nkzw-tech/fate/blob/
|
|
54
|
+
Defined in: [fate/src/client.ts:484](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L484)
|
|
55
55
|
|
|
56
56
|
***
|
|
57
57
|
|
|
@@ -59,7 +59,7 @@ Defined in: [fate/src/client.ts:484](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
59
59
|
|
|
60
60
|
> `readonly` `optional` **persistence?**: [`PersistenceSession`](../interfaces/PersistenceSession.md)
|
|
61
61
|
|
|
62
|
-
Defined in: [fate/src/client.ts:482](https://github.com/nkzw-tech/fate/blob/
|
|
62
|
+
Defined in: [fate/src/client.ts:482](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L482)
|
|
63
63
|
|
|
64
64
|
***
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ Defined in: [fate/src/client.ts:482](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
67
67
|
|
|
68
68
|
> `readonly` **roots**: `Roots`
|
|
69
69
|
|
|
70
|
-
Defined in: [fate/src/client.ts:485](https://github.com/nkzw-tech/fate/blob/
|
|
70
|
+
Defined in: [fate/src/client.ts:485](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L485)
|
|
71
71
|
|
|
72
72
|
***
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ Defined in: [fate/src/client.ts:485](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
75
75
|
|
|
76
76
|
> `readonly` **store**: `Store`
|
|
77
77
|
|
|
78
|
-
Defined in: [fate/src/client.ts:464](https://github.com/nkzw-tech/fate/blob/
|
|
78
|
+
Defined in: [fate/src/client.ts:464](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L464)
|
|
79
79
|
|
|
80
80
|
## Methods
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ Defined in: [fate/src/client.ts:464](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
83
83
|
|
|
84
84
|
> **assertLiveConnectionSupport**(): `void`
|
|
85
85
|
|
|
86
|
-
Defined in: [fate/src/client.ts:1276](https://github.com/nkzw-tech/fate/blob/
|
|
86
|
+
Defined in: [fate/src/client.ts:1276](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1276)
|
|
87
87
|
|
|
88
88
|
#### Returns
|
|
89
89
|
|
|
@@ -95,7 +95,7 @@ Defined in: [fate/src/client.ts:1276](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
95
95
|
|
|
96
96
|
> **assertLiveViewSupport**(): `void`
|
|
97
97
|
|
|
98
|
-
Defined in: [fate/src/client.ts:1268](https://github.com/nkzw-tech/fate/blob/
|
|
98
|
+
Defined in: [fate/src/client.ts:1268](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1268)
|
|
99
99
|
|
|
100
100
|
#### Returns
|
|
101
101
|
|
|
@@ -107,7 +107,7 @@ Defined in: [fate/src/client.ts:1268](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
107
107
|
|
|
108
108
|
> **dehydrate**(): [`FateDehydratedState`](../type-aliases/FateDehydratedState.md)\<`HydrationScope`\>
|
|
109
109
|
|
|
110
|
-
Defined in: [fate/src/client.ts:590](https://github.com/nkzw-tech/fate/blob/
|
|
110
|
+
Defined in: [fate/src/client.ts:590](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L590)
|
|
111
111
|
|
|
112
112
|
Exports the durable normalized cache as an opaque JSON-safe value for SSR
|
|
113
113
|
transfer or persistence. Runtime requests, subscriptions, retainers, and
|
|
@@ -123,7 +123,7 @@ optimistic state are intentionally excluded.
|
|
|
123
123
|
|
|
124
124
|
> **deleteRecord**(`type`, `id`): `void`
|
|
125
125
|
|
|
126
|
-
Defined in: [fate/src/client.ts:950](https://github.com/nkzw-tech/fate/blob/
|
|
126
|
+
Defined in: [fate/src/client.ts:950](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L950)
|
|
127
127
|
|
|
128
128
|
#### Parameters
|
|
129
129
|
|
|
@@ -145,7 +145,7 @@ Defined in: [fate/src/client.ts:950](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
145
145
|
|
|
146
146
|
> **executeMutation**(`key`, `input`, `select`, `options?`): `Promise`\<`unknown`\>
|
|
147
147
|
|
|
148
|
-
Defined in: [fate/src/client.ts:902](https://github.com/nkzw-tech/fate/blob/
|
|
148
|
+
Defined in: [fate/src/client.ts:902](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L902)
|
|
149
149
|
|
|
150
150
|
#### Parameters
|
|
151
151
|
|
|
@@ -185,7 +185,7 @@ Defined in: [fate/src/client.ts:902](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
185
185
|
|
|
186
186
|
> **gc**(): `void`
|
|
187
187
|
|
|
188
|
-
Defined in: [fate/src/client.ts:2240](https://github.com/nkzw-tech/fate/blob/
|
|
188
|
+
Defined in: [fate/src/client.ts:2240](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2240)
|
|
189
189
|
|
|
190
190
|
Removes records and lists that are not reachable from retained requests or
|
|
191
191
|
the release buffer.
|
|
@@ -204,7 +204,7 @@ memory-management flows.
|
|
|
204
204
|
|
|
205
205
|
> **getRequestKey**(`request`): `string`
|
|
206
206
|
|
|
207
|
-
Defined in: [fate/src/client.ts:2525](https://github.com/nkzw-tech/fate/blob/
|
|
207
|
+
Defined in: [fate/src/client.ts:2525](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2525)
|
|
208
208
|
|
|
209
209
|
#### Parameters
|
|
210
210
|
|
|
@@ -222,7 +222,7 @@ Defined in: [fate/src/client.ts:2525](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
222
222
|
|
|
223
223
|
> **getRequestResult**\<`R`\>(`request`): [`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>
|
|
224
224
|
|
|
225
|
-
Defined in: [fate/src/client.ts:2702](https://github.com/nkzw-tech/fate/blob/
|
|
225
|
+
Defined in: [fate/src/client.ts:2702](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2702)
|
|
226
226
|
|
|
227
227
|
#### Type Parameters
|
|
228
228
|
|
|
@@ -246,7 +246,7 @@ Defined in: [fate/src/client.ts:2702](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
246
246
|
|
|
247
247
|
> **getTypeConfig**(`type`): [`TypeConfig`](../type-aliases/TypeConfig.md)
|
|
248
248
|
|
|
249
|
-
Defined in: [fate/src/client.ts:839](https://github.com/nkzw-tech/fate/blob/
|
|
249
|
+
Defined in: [fate/src/client.ts:839](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L839)
|
|
250
250
|
|
|
251
251
|
#### Parameters
|
|
252
252
|
|
|
@@ -264,7 +264,7 @@ Defined in: [fate/src/client.ts:839](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
264
264
|
|
|
265
265
|
> **hydrate**(`state`, `options?`): `void`
|
|
266
266
|
|
|
267
|
-
Defined in: [fate/src/client.ts:617](https://github.com/nkzw-tech/fate/blob/
|
|
267
|
+
Defined in: [fate/src/client.ts:617](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L617)
|
|
268
268
|
|
|
269
269
|
Restores a durable normalized cache snapshot without restoring runtime
|
|
270
270
|
request handles, retainers, subscriptions, or optimistic update state.
|
|
@@ -290,7 +290,7 @@ Hydrate before rendering SSR content. Replaying the same snapshot is safe.
|
|
|
290
290
|
|
|
291
291
|
> **loadConnection**\<`V`\>(`view`, `connection`, `args`, `options?`): `Promise`\<`Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: readonly (`string` \| `undefined`)[]; `forwardPageLimit?`: `number`; `ids`: readonly `string`[]; `liveAfterIds?`: readonly `string`[]; `liveBeforeIds?`: readonly `string`[]; `pagination?`: [`Pagination`](../type-aliases/Pagination.md); `pendingAfterIds?`: readonly `string`[]; `pendingBeforeIds?`: readonly `string`[]; \}\> \| `undefined`\>
|
|
292
292
|
|
|
293
|
-
Defined in: [fate/src/client.ts:1928](https://github.com/nkzw-tech/fate/blob/
|
|
293
|
+
Defined in: [fate/src/client.ts:1928](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1928)
|
|
294
294
|
|
|
295
295
|
#### Type Parameters
|
|
296
296
|
|
|
@@ -328,7 +328,7 @@ Defined in: [fate/src/client.ts:1928](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
328
328
|
|
|
329
329
|
> **prepareRequestForRender**\<`R`\>(`request`, `options`): `Readonly`\<\{ `promise`: `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>; `requestKey`: `string`; \}\>
|
|
330
330
|
|
|
331
|
-
Defined in: [fate/src/client.ts:2101](https://github.com/nkzw-tech/fate/blob/
|
|
331
|
+
Defined in: [fate/src/client.ts:2101](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2101)
|
|
332
332
|
|
|
333
333
|
#### Type Parameters
|
|
334
334
|
|
|
@@ -356,7 +356,7 @@ Defined in: [fate/src/client.ts:2101](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
356
356
|
|
|
357
357
|
> **readDeferred**\<`T`\>(`deferred`): `PromiseLike`\<`Readonly`\<\{ `coverage`: readonly readonly \[`string`, `ReadonlySet`\<`string`\>\][]; `data`: `T`; \}\>\>
|
|
358
358
|
|
|
359
|
-
Defined in: [fate/src/client.ts:1171](https://github.com/nkzw-tech/fate/blob/
|
|
359
|
+
Defined in: [fate/src/client.ts:1171](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1171)
|
|
360
360
|
|
|
361
361
|
#### Type Parameters
|
|
362
362
|
|
|
@@ -380,7 +380,7 @@ Defined in: [fate/src/client.ts:1171](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
380
380
|
|
|
381
381
|
> **readView**\<`T`, `S`, `V`\>(`view`, `ref`): [`FateThenable`](../interfaces/FateThenable.md)\<`Readonly`\<\{ `coverage`: readonly readonly \[`string`, `ReadonlySet`\<`string`\>\][]; `data`: [`ViewData`](../type-aliases/ViewData.md)\<`T`, `S`\>; \}\>\>
|
|
382
382
|
|
|
383
|
-
Defined in: [fate/src/client.ts:997](https://github.com/nkzw-tech/fate/blob/
|
|
383
|
+
Defined in: [fate/src/client.ts:997](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L997)
|
|
384
384
|
|
|
385
385
|
#### Type Parameters
|
|
386
386
|
|
|
@@ -416,7 +416,7 @@ Defined in: [fate/src/client.ts:997](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
416
416
|
|
|
417
417
|
> **ref**\<`T`\>(`type`, `id`, `view`): [`ViewRef`](../type-aliases/ViewRef.md)\<`T`\[`"__typename"`\]\>
|
|
418
418
|
|
|
419
|
-
Defined in: [fate/src/client.ts:984](https://github.com/nkzw-tech/fate/blob/
|
|
419
|
+
Defined in: [fate/src/client.ts:984](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L984)
|
|
420
420
|
|
|
421
421
|
#### Type Parameters
|
|
422
422
|
|
|
@@ -448,7 +448,7 @@ Defined in: [fate/src/client.ts:984](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
448
448
|
|
|
449
449
|
> **registerPendingOptimisticMutation**(`entityId`, `promise`): `void`
|
|
450
450
|
|
|
451
|
-
Defined in: [fate/src/client.ts:1891](https://github.com/nkzw-tech/fate/blob/
|
|
451
|
+
Defined in: [fate/src/client.ts:1891](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1891)
|
|
452
452
|
|
|
453
453
|
#### Parameters
|
|
454
454
|
|
|
@@ -470,7 +470,7 @@ Defined in: [fate/src/client.ts:1891](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
470
470
|
|
|
471
471
|
> **releaseRequest**(`request`, `mode`): `void`
|
|
472
472
|
|
|
473
|
-
Defined in: [fate/src/client.ts:2179](https://github.com/nkzw-tech/fate/blob/
|
|
473
|
+
Defined in: [fate/src/client.ts:2179](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2179)
|
|
474
474
|
|
|
475
475
|
#### Parameters
|
|
476
476
|
|
|
@@ -492,7 +492,7 @@ Defined in: [fate/src/client.ts:2179](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
492
492
|
|
|
493
493
|
> **releaseRequestKey**(`requestKey`, `mode`): `void`
|
|
494
494
|
|
|
495
|
-
Defined in: [fate/src/client.ts:2183](https://github.com/nkzw-tech/fate/blob/
|
|
495
|
+
Defined in: [fate/src/client.ts:2183](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2183)
|
|
496
496
|
|
|
497
497
|
#### Parameters
|
|
498
498
|
|
|
@@ -514,7 +514,7 @@ Defined in: [fate/src/client.ts:2183](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
514
514
|
|
|
515
515
|
> **request**\<`R`\>(`request`, `options?`): `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
516
516
|
|
|
517
|
-
Defined in: [fate/src/client.ts:2079](https://github.com/nkzw-tech/fate/blob/
|
|
517
|
+
Defined in: [fate/src/client.ts:2079](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2079)
|
|
518
518
|
|
|
519
519
|
#### Type Parameters
|
|
520
520
|
|
|
@@ -542,7 +542,7 @@ Defined in: [fate/src/client.ts:2079](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
542
542
|
|
|
543
543
|
> **requestForRender**\<`R`\>(`request`, `options?`): `Promise`\<[`RequestResult`](../type-aliases/RequestResult.md)\<`Roots`, `R`\>\>
|
|
544
544
|
|
|
545
|
-
Defined in: [fate/src/client.ts:2094](https://github.com/nkzw-tech/fate/blob/
|
|
545
|
+
Defined in: [fate/src/client.ts:2094](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2094)
|
|
546
546
|
|
|
547
547
|
#### Type Parameters
|
|
548
548
|
|
|
@@ -570,7 +570,7 @@ Defined in: [fate/src/client.ts:2094](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
570
570
|
|
|
571
571
|
> **resolveOptimisticEntity**(`optimisticEntityId`, `resolvedEntityId`): `void`
|
|
572
572
|
|
|
573
|
-
Defined in: [fate/src/client.ts:1916](https://github.com/nkzw-tech/fate/blob/
|
|
573
|
+
Defined in: [fate/src/client.ts:1916](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1916)
|
|
574
574
|
|
|
575
575
|
#### Parameters
|
|
576
576
|
|
|
@@ -592,7 +592,7 @@ Defined in: [fate/src/client.ts:1916](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
592
592
|
|
|
593
593
|
> **retain**(`request`): `RetainHandle`
|
|
594
594
|
|
|
595
|
-
Defined in: [fate/src/client.ts:2214](https://github.com/nkzw-tech/fate/blob/
|
|
595
|
+
Defined in: [fate/src/client.ts:2214](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2214)
|
|
596
596
|
|
|
597
597
|
Keeps the records and lists reachable from a request alive until the
|
|
598
598
|
returned handle is disposed.
|
|
@@ -617,7 +617,7 @@ that must survive manual garbage collection.
|
|
|
617
617
|
|
|
618
618
|
> **retainRequestKey**(`requestKey`, `mode?`): `RetainHandle`
|
|
619
619
|
|
|
620
|
-
Defined in: [fate/src/client.ts:2195](https://github.com/nkzw-tech/fate/blob/
|
|
620
|
+
Defined in: [fate/src/client.ts:2195](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2195)
|
|
621
621
|
|
|
622
622
|
#### Parameters
|
|
623
623
|
|
|
@@ -639,7 +639,7 @@ Defined in: [fate/src/client.ts:2195](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
639
639
|
|
|
640
640
|
> **rootListRef**(`entityId`, `rootView`): `Readonly`\<\{ `__typename`: `string`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
|
|
641
641
|
|
|
642
|
-
Defined in: [fate/src/client.ts:992](https://github.com/nkzw-tech/fate/blob/
|
|
642
|
+
Defined in: [fate/src/client.ts:992](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L992)
|
|
643
643
|
|
|
644
644
|
#### Parameters
|
|
645
645
|
|
|
@@ -661,7 +661,7 @@ Defined in: [fate/src/client.ts:992](https://github.com/nkzw-tech/fate/blob/ce96
|
|
|
661
661
|
|
|
662
662
|
> **subscribeLiveListView**\<`V`\>(`view`, `connection`): () => `void`
|
|
663
663
|
|
|
664
|
-
Defined in: [fate/src/client.ts:1369](https://github.com/nkzw-tech/fate/blob/
|
|
664
|
+
Defined in: [fate/src/client.ts:1369](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1369)
|
|
665
665
|
|
|
666
666
|
#### Type Parameters
|
|
667
667
|
|
|
@@ -689,7 +689,7 @@ Defined in: [fate/src/client.ts:1369](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
689
689
|
|
|
690
690
|
> **subscribeLiveView**\<`T`, `S`, `V`\>(`view`, `ref`): () => `void`
|
|
691
691
|
|
|
692
|
-
Defined in: [fate/src/client.ts:1284](https://github.com/nkzw-tech/fate/blob/
|
|
692
|
+
Defined in: [fate/src/client.ts:1284](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L1284)
|
|
693
693
|
|
|
694
694
|
#### Type Parameters
|
|
695
695
|
|
|
@@ -725,7 +725,7 @@ Defined in: [fate/src/client.ts:1284](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
725
725
|
|
|
726
726
|
> **trackPendingRequest**\<`T`\>(`request`): `Promise`\<`T`\>
|
|
727
727
|
|
|
728
|
-
Defined in: [fate/src/client.ts:2474](https://github.com/nkzw-tech/fate/blob/
|
|
728
|
+
Defined in: [fate/src/client.ts:2474](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L2474)
|
|
729
729
|
|
|
730
730
|
#### Type Parameters
|
|
731
731
|
|
|
@@ -749,7 +749,7 @@ Defined in: [fate/src/client.ts:2474](https://github.com/nkzw-tech/fate/blob/ce9
|
|
|
749
749
|
|
|
750
750
|
> **write**(`type`, `data`, `select`, `plan?`, `insert?`): `string`
|
|
751
751
|
|
|
752
|
-
Defined in: [fate/src/client.ts:940](https://github.com/nkzw-tech/fate/blob/
|
|
752
|
+
Defined in: [fate/src/client.ts:940](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/client.ts#L940)
|
|
753
753
|
|
|
754
754
|
#### Parameters
|
|
755
755
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **clientRoot**\<`Result`, `Type`\>(`type`): `RootDefinition`\<`Type`, `Result`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/root.ts:7](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/root.ts:7](https://github.com/nkzw-tech/fate/blob/773f575cc13a2695a877106a1b35db101b2e431d/packages/fate/src/root.ts#L7)
|
|
6
6
|
|
|
7
7
|
Defines a root query for an entity type, capturing the response shape.
|
|
8
8
|
|