@nkzw/fate 1.5.2 → 1.6.0
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 +51 -155
- 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/integrations/cloudflare.md +21 -139
- package/docs/integrations/void.md +33 -19
- 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
|
@@ -2995,7 +2995,7 @@ _And you are all set. Happy building!_
|
|
|
2995
2995
|
|
|
2996
2996
|
## Void Integration
|
|
2997
2997
|
|
|
2998
|
-
`void-fate` is the
|
|
2998
|
+
`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
2999
|
|
|
3000
3000
|
Use this integration when your app runs on Void and you want the example app's
|
|
3001
3001
|
setup without copying its adapter glue.
|
|
@@ -3122,14 +3122,29 @@ live.connection('Post.comments', { id: postId }).appendNode('Comment', commentId
|
|
|
3122
3122
|
|
|
3123
3123
|
### Routes
|
|
3124
3124
|
|
|
3125
|
+
Define a live stream once in a server-only module:
|
|
3126
|
+
|
|
3127
|
+
```ts
|
|
3128
|
+
// src/fate/live.ts
|
|
3129
|
+
import { defineLiveStream } from 'void/live';
|
|
3130
|
+
|
|
3131
|
+
export const fateStream = defineLiveStream({
|
|
3132
|
+
allowAnonymousControl: true,
|
|
3133
|
+
id: 'fate',
|
|
3134
|
+
});
|
|
3135
|
+
```
|
|
3136
|
+
|
|
3125
3137
|
Add one route for fate RPC requests:
|
|
3126
3138
|
|
|
3127
3139
|
```tsx
|
|
3128
3140
|
// routes/fate.ts
|
|
3129
3141
|
import { defineVoidFateRoute } from 'void-fate/server';
|
|
3142
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
3130
3143
|
import { fateLive, fateServer } from '../src/fate/server.ts';
|
|
3131
3144
|
|
|
3132
|
-
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive
|
|
3145
|
+
export const { GET, POST } = defineVoidFateRoute(fateServer, fateLive, {
|
|
3146
|
+
stream: fateStream,
|
|
3147
|
+
});
|
|
3133
3148
|
```
|
|
3134
3149
|
|
|
3135
3150
|
Add a second route for the live SSE transport:
|
|
@@ -3137,9 +3152,9 @@ Add a second route for the live SSE transport:
|
|
|
3137
3152
|
```tsx
|
|
3138
3153
|
// routes/fate-live.ts
|
|
3139
3154
|
import { defineVoidFateLiveRoute } from 'void-fate/server';
|
|
3140
|
-
import {
|
|
3155
|
+
import { fateStream } from '../src/fate/live.ts';
|
|
3141
3156
|
|
|
3142
|
-
export const { GET, POST } = defineVoidFateLiveRoute(
|
|
3157
|
+
export const { GET, POST } = defineVoidFateLiveRoute(fateStream);
|
|
3143
3158
|
```
|
|
3144
3159
|
|
|
3145
3160
|
The live route handles `GET /fate-live` SSE connections and `POST /fate-live`
|
|
@@ -3205,13 +3220,7 @@ present.
|
|
|
3205
3220
|
### Custom Paths
|
|
3206
3221
|
|
|
3207
3222
|
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
|
-
```
|
|
3223
|
+
different paths, update your route filenames and configure the matching client paths.
|
|
3215
3224
|
|
|
3216
3225
|
::: code-group
|
|
3217
3226
|
|
|
@@ -3247,179 +3256,66 @@ or router configuration matches the paths you pass to the client.
|
|
|
3247
3256
|
|
|
3248
3257
|
### Live Transport
|
|
3249
3258
|
|
|
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.
|
|
3259
|
+
`createVoidFateLive` publishes entity and connection events through the `void/live`
|
|
3260
|
+
stream associated with the current request. Void manages the Durable Object
|
|
3261
|
+
transport that distributes events to connected clients across requests.
|
|
3258
3262
|
|
|
3259
3263
|
The live transport is best-effort and does not replay missed events after a
|
|
3260
3264
|
client reconnects. This matches fate's default in-memory live event bus.
|
|
3261
3265
|
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
`cf-fate` is the first-class Cloudflare Workers adapter for Fate native HTTP transport and live views.
|
|
3265
|
-
|
|
3266
|
-
Use it when your backend runs directly on Cloudflare Workers and you want fate live views without adopting the Void platform.
|
|
3267
|
-
|
|
3268
|
-
### New Project
|
|
3266
|
+
### Cloudflare Deployment
|
|
3269
3267
|
|
|
3270
|
-
|
|
3268
|
+
From your project root, run:
|
|
3271
3269
|
|
|
3272
3270
|
```sh
|
|
3273
|
-
vp
|
|
3271
|
+
vp exec void deploy --platform cloudflare
|
|
3274
3272
|
```
|
|
3275
3273
|
|
|
3276
|
-
|
|
3274
|
+
Void provisions resources and deploys directly to your Cloudflare account. See the [Cloudflare integration](/docs/integrations/cloudflare.md) for setup and migration instructions.
|
|
3277
3275
|
|
|
3278
|
-
|
|
3279
|
-
vp create fate my-app --template cloudflare --framework vue
|
|
3280
|
-
```
|
|
3276
|
+
## Cloudflare Integration
|
|
3281
3277
|
|
|
3282
|
-
|
|
3278
|
+
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
3279
|
|
|
3284
|
-
|
|
3280
|
+
### New Project
|
|
3285
3281
|
|
|
3286
3282
|
```sh
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
For Vue clients, replace `react-fate` with `vue-fate`.
|
|
3292
|
-
|
|
3293
|
-
### Server Setup
|
|
3294
|
-
|
|
3295
|
-
Create a Cloudflare live stream and pass its Fate live facade to `createFateServer`.
|
|
3296
|
-
|
|
3297
|
-
```ts
|
|
3298
|
-
// src/fate/live.ts
|
|
3299
|
-
import { defineCloudflareFateLiveStream } from 'cf-fate/server';
|
|
3300
|
-
|
|
3301
|
-
export const fateStream = defineCloudflareFateLiveStream({
|
|
3302
|
-
allowAnonymousControl: true,
|
|
3303
|
-
binding: 'FATE_LIVE',
|
|
3304
|
-
id: 'fate',
|
|
3305
|
-
});
|
|
3306
|
-
```
|
|
3307
|
-
|
|
3308
|
-
```ts
|
|
3309
|
-
// src/fate/server.ts
|
|
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);
|
|
3283
|
+
vp create fate my-app --template void
|
|
3284
|
+
cd my-app
|
|
3285
|
+
vp run dev:setup
|
|
3286
|
+
vp run dev
|
|
3329
3287
|
```
|
|
3330
3288
|
|
|
3331
|
-
|
|
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
|
-
```
|
|
3289
|
+
Add `--framework vue` to the create command to use Vue instead of React.
|
|
3364
3290
|
|
|
3365
|
-
###
|
|
3291
|
+
### Deploy
|
|
3366
3292
|
|
|
3367
|
-
|
|
3293
|
+
From the project root:
|
|
3368
3294
|
|
|
3369
|
-
```
|
|
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
|
-
}
|
|
3295
|
+
```sh
|
|
3296
|
+
vp exec void deploy --platform cloudflare
|
|
3387
3297
|
```
|
|
3388
3298
|
|
|
3389
|
-
|
|
3299
|
+
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
3300
|
|
|
3391
|
-
|
|
3301
|
+
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
3302
|
|
|
3393
|
-
|
|
3394
|
-
import { fate } from 'react-fate/vite';
|
|
3303
|
+
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
3304
|
|
|
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';
|
|
3305
|
+
See [Void's Cloudflare deployment guide](https://void.cloud/integrations/cloudflare) for custom domains, secrets, and CI configuration.
|
|
3407
3306
|
|
|
3408
|
-
|
|
3409
|
-
liveUrl: 'http://localhost:8787/fate-live',
|
|
3410
|
-
url: 'http://localhost:8787/fate',
|
|
3411
|
-
});
|
|
3307
|
+
### Migrating from cf-fate
|
|
3412
3308
|
|
|
3413
|
-
|
|
3414
|
-
return <FateClient client={fate}>{children}</FateClient>;
|
|
3415
|
-
}
|
|
3416
|
-
```
|
|
3309
|
+
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
3310
|
|
|
3418
|
-
|
|
3311
|
+
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
3312
|
|
|
3420
|
-
|
|
3313
|
+
- Define the live stream with `defineLiveStream` from `void/live`.
|
|
3314
|
+
- Use `createVoidFateLive`, `defineVoidFateRoute`, and `defineVoidFateLiveRoute` from `void-fate/server`.
|
|
3315
|
+
- Let the generated client use `void/live/client` for live connections.
|
|
3316
|
+
- Remove the `cf-fate` dependency and the custom Worker entry point.
|
|
3421
3317
|
|
|
3422
|
-
|
|
3318
|
+
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
3319
|
|
|
3424
3320
|
## Frequently Asked Questions
|
|
3425
3321
|
|
|
@@ -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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/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/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/root.ts#L7)
|
|
6
6
|
|
|
7
7
|
Defines a root query for an entity type, capturing the response shape.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **createClient**\<`T`, `HydrationScope`\>(`options`): [`FateClient`](../classes/FateClient.md)\<`T`\[`0`\], `T`\[`1`\], `HydrationScope`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/client.ts:3522](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/client.ts:3522](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/client.ts#L3522)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **createGraphQLTransport**\<`Mutations`\>(`__namedParameters`): [`Transport`](../interfaces/Transport.md)\<`Mutations`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/graphqlTransport.ts:579](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/graphqlTransport.ts:579](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/graphqlTransport.ts#L579)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **createHTTPTransport**\<`API`, `Mutations`\>(`__namedParameters`): [`Transport`](../interfaces/Transport.md)\<`Mutations`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/httpTransport.ts:265](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/httpTransport.ts:265](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/httpTransport.ts#L265)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **createTRPCTransport**\<`AppRouter`, `Mutations`\>(`__namedParameters`): [`Transport`](../interfaces/Transport.md)\<`MutationMapFromResolvers`\<`Mutations`\>\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/transport.ts:160](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/transport.ts:160](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/transport.ts#L160)
|
|
6
6
|
|
|
7
7
|
Builds a `Transport` backed by a tRPC client using the configured resolvers
|
|
8
8
|
for by-id queries, lists, and mutations.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **defer**\<`S`\>(`selection`): [`DeferredSelection`](../type-aliases/DeferredSelection.md)\<`S`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [fate/src/defer.ts:9](https://github.com/nkzw-tech/fate/blob/
|
|
5
|
+
Defined in: [fate/src/defer.ts:9](https://github.com/nkzw-tech/fate/blob/affa9937a4bbf38447b9faf2621c79005aff82c6/packages/fate/src/defer.ts#L9)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|