vue-fate 1.7.7 → 1.8.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 +11 -11
- package/docs/api/index.md +3 -0
- package/docs/api/react-fate/src/functions/alias.md +57 -0
- package/docs/api/react-fate/src/functions/clientRoot.md +31 -0
- package/docs/api/react-fate/src/functions/createClient.md +25 -0
- package/docs/api/react-fate/src/functions/createGraphQLTransport.md +21 -0
- package/docs/api/react-fate/src/functions/createHTTPTransport.md +51 -0
- package/docs/api/react-fate/src/functions/createTRPCTransport.md +50 -0
- package/docs/api/react-fate/src/functions/defer.md +21 -0
- package/docs/api/react-fate/src/functions/graphqlMutation.md +39 -0
- package/docs/api/react-fate/src/functions/mutation.md +32 -0
- package/docs/api/react-fate/src/functions/view.md +26 -0
- package/docs/api/react-fate/src/functions/when.md +31 -0
- package/docs/api/react-fate/src/interfaces/Persistence.md +5 -0
- package/docs/api/react-fate/src/interfaces/PersistenceSession.md +109 -0
- package/docs/api/react-fate/src/type-aliases/AliasedSelection.md +15 -0
- package/docs/api/react-fate/src/type-aliases/AliasedView.md +11 -0
- package/docs/api/react-fate/src/type-aliases/ConditionalSelection.md +15 -0
- package/docs/api/react-fate/src/type-aliases/ConnectionRef.md +13 -0
- package/docs/api/react-fate/src/type-aliases/Deferred.md +19 -0
- package/docs/api/react-fate/src/type-aliases/FateDehydratedState.md +11 -0
- package/docs/api/react-fate/src/type-aliases/GraphQLMutationDefinition.md +19 -0
- package/docs/api/react-fate/src/type-aliases/GraphQLMutationInput.md +11 -0
- package/docs/api/react-fate/src/type-aliases/GraphQLMutationMap.md +11 -0
- package/docs/api/react-fate/src/type-aliases/GraphQLMutationOutput.md +11 -0
- package/docs/api/react-fate/src/type-aliases/GraphQLTransportOptions.md +151 -0
- package/docs/api/react-fate/src/type-aliases/HydrateOptions.md +7 -0
- package/docs/api/react-fate/src/type-aliases/HydrationLimits.md +7 -0
- package/docs/api/react-fate/src/type-aliases/InferFateAPI.md +11 -0
- package/docs/api/react-fate/src/type-aliases/Pagination.md +39 -0
- package/docs/api/react-fate/src/type-aliases/ParameterizedView.md +19 -0
- package/docs/api/react-fate/src/type-aliases/PersistenceSnapshot.md +5 -0
- package/docs/api/react-fate/src/type-aliases/ViewRef.md +13 -0
- package/docs/api/react-fate/src/variables/toEntityId.md +21 -0
- package/docs/api/vue-fate/functions/createFatePlugin.md +15 -0
- package/docs/api/vue-fate/functions/provideFateClient.md +15 -0
- package/docs/api/vue-fate/functions/useFateClient.md +17 -0
- package/docs/api/vue-fate/functions/useListView.md +27 -0
- package/docs/api/vue-fate/functions/useLiveListView.md +27 -0
- package/docs/api/vue-fate/functions/useLiveView.md +93 -0
- package/docs/api/vue-fate/functions/useRequest.md +31 -0
- package/docs/api/vue-fate/functions/useView.md +93 -0
- package/docs/api/vue-fate/index.md +223 -0
- package/docs/api/vue-fate/type-aliases/ListViewState.md +45 -0
- package/docs/api/vue-fate/type-aliases/RequestResource.md +71 -0
- package/docs/api/vue-fate/type-aliases/ViewResource.md +45 -0
- package/docs/api/vue-fate/variables/FateClient.md +7 -0
- package/docs/api/vue-fate/variables/FateClientKey.md +5 -0
- package/docs/guide/actions.md +305 -0
- package/docs/guide/core-concepts.md +22 -0
- package/docs/guide/deferred-views.md +62 -0
- package/docs/guide/getting-started.md +71 -0
- package/docs/guide/list-views.md +86 -0
- package/docs/guide/live-views.md +258 -0
- package/docs/guide/persistence.md +321 -0
- package/docs/guide/requests.md +270 -0
- package/docs/guide/views.md +368 -0
- package/docs/guide/vue.md +256 -0
- package/docs/guide/why-fate.md +40 -0
- package/docs/index.md +5 -0
- package/docs/integrations/cloudflare.md +43 -0
- package/docs/integrations/graphql.md +444 -0
- package/docs/integrations/server.md +731 -0
- package/docs/integrations/void.md +279 -0
- package/lib/client.mjs +1 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -437,8 +437,8 @@ ViewRefs carry a set of view names they can resolve. `useView` throws if a ref d
|
|
|
437
437
|
A view can take parameters. Define the selection with a function, then bind its parameters where you request or compose the view:
|
|
438
438
|
|
|
439
439
|
```tsx
|
|
440
|
-
import { alias, useRequest, useView, view, when, type ViewRef } from 'react-fate';
|
|
441
440
|
import type { User } from '@your-org/server/views';
|
|
441
|
+
import { alias, useRequest, useView, view, when, type ViewRef } from 'react-fate';
|
|
442
442
|
|
|
443
443
|
const AccountView = view<User>()({ email: true });
|
|
444
444
|
|
|
@@ -1391,8 +1391,8 @@ export const fate = createFateServer({
|
|
|
1391
1391
|
The equivalent tRPC mutation lives in your router and returns the selected shape that the client asked for:
|
|
1392
1392
|
|
|
1393
1393
|
```tsx
|
|
1394
|
-
import { z } from 'zod';
|
|
1395
1394
|
import { connectionArgs, createResolver } from '@nkzw/fate/server';
|
|
1395
|
+
import { z } from 'zod';
|
|
1396
1396
|
import { procedure, router } from '../init.ts';
|
|
1397
1397
|
import { postDataView, PostItem } from '../views.ts';
|
|
1398
1398
|
|
|
@@ -1525,8 +1525,8 @@ vp add @nkzw/fate-indexeddb
|
|
|
1525
1525
|
Then pass `persistence` when creating the client:
|
|
1526
1526
|
|
|
1527
1527
|
```tsx
|
|
1528
|
-
import { createPersistence } from '@nkzw/fate/persistence';
|
|
1529
1528
|
import { createIndexedDBStorage } from '@nkzw/fate-indexeddb';
|
|
1529
|
+
import { createPersistence } from '@nkzw/fate/persistence';
|
|
1530
1530
|
import { createFateClient } from 'react-fate/client';
|
|
1531
1531
|
|
|
1532
1532
|
const fate = createFateClient({
|
|
@@ -1863,9 +1863,9 @@ If your server lives in a separate package, install `@nkzw/fate` there as a runt
|
|
|
1863
1863
|
Use the Vue adapter's Vite plugin in the client app:
|
|
1864
1864
|
|
|
1865
1865
|
```ts
|
|
1866
|
-
import { fate } from 'vue-fate/vite';
|
|
1867
|
-
import { defineConfig } from 'vite';
|
|
1868
1866
|
import vue from '@vitejs/plugin-vue';
|
|
1867
|
+
import { defineConfig } from 'vite';
|
|
1868
|
+
import { fate } from 'vue-fate/vite';
|
|
1869
1869
|
|
|
1870
1870
|
export default defineConfig({
|
|
1871
1871
|
plugins: [
|
|
@@ -2213,8 +2213,8 @@ export default defineConfig({
|
|
|
2213
2213
|
|
|
2214
2214
|
```ts [Vue]
|
|
2215
2215
|
import vue from '@vitejs/plugin-vue';
|
|
2216
|
-
import { fate } from 'vue-fate/vite';
|
|
2217
2216
|
import { defineConfig } from 'vite';
|
|
2217
|
+
import { fate } from 'vue-fate/vite';
|
|
2218
2218
|
|
|
2219
2219
|
export default defineConfig({
|
|
2220
2220
|
plugins: [
|
|
@@ -2737,8 +2737,8 @@ export default defineConfig({
|
|
|
2737
2737
|
|
|
2738
2738
|
```ts [Vue]
|
|
2739
2739
|
import vue from '@vitejs/plugin-vue';
|
|
2740
|
-
import { fate } from 'vue-fate/vite';
|
|
2741
2740
|
import { defineConfig } from 'vite';
|
|
2741
|
+
import { fate } from 'vue-fate/vite';
|
|
2742
2742
|
|
|
2743
2743
|
export default defineConfig({
|
|
2744
2744
|
plugins: [
|
|
@@ -2877,8 +2877,8 @@ Pass the `Root` export from `views.ts` to fate in your tRPC `init.ts` file. fate
|
|
|
2877
2877
|
Use `createPrismaFate` from `@nkzw/fate/server/prisma` next to your tRPC helpers. By default, fate reads Prisma delegates from `ctx.prisma` using each data view's type name:
|
|
2878
2878
|
|
|
2879
2879
|
```tsx
|
|
2880
|
-
import { initTRPC } from '@trpc/server';
|
|
2881
2880
|
import { createPrismaFate } from '@nkzw/fate/server/prisma';
|
|
2881
|
+
import { initTRPC } from '@trpc/server';
|
|
2882
2882
|
import type { AppContext } from './context.ts';
|
|
2883
2883
|
import { Root } from './views.ts';
|
|
2884
2884
|
|
|
@@ -2926,8 +2926,8 @@ return plan.resolve(post);
|
|
|
2926
2926
|
Use `createDrizzleFate` from `@nkzw/fate/server/drizzle`. fate matches data view type names to Drizzle tables from your schema. The `db` option can be a Drizzle database object or a function that receives your tRPC context and returns a request-scoped database object:
|
|
2927
2927
|
|
|
2928
2928
|
```tsx
|
|
2929
|
-
import { initTRPC } from '@trpc/server';
|
|
2930
2929
|
import { createDrizzleFate } from '@nkzw/fate/server/drizzle';
|
|
2930
|
+
import { initTRPC } from '@trpc/server';
|
|
2931
2931
|
import db from '../drizzle/db.ts';
|
|
2932
2932
|
import schema from '../drizzle/schema.ts';
|
|
2933
2933
|
import type { AppContext } from './context.ts';
|
|
@@ -3168,8 +3168,8 @@ export default defineConfig({
|
|
|
3168
3168
|
|
|
3169
3169
|
```ts [Vue]
|
|
3170
3170
|
import vue from '@vitejs/plugin-vue';
|
|
3171
|
-
import { fate } from 'vue-fate/vite';
|
|
3172
3171
|
import { defineConfig } from 'vite';
|
|
3172
|
+
import { fate } from 'vue-fate/vite';
|
|
3173
3173
|
|
|
3174
3174
|
export default defineConfig({
|
|
3175
3175
|
plugins: [
|
|
@@ -3327,9 +3327,9 @@ export default defineConfig({
|
|
|
3327
3327
|
|
|
3328
3328
|
```ts [Vue]
|
|
3329
3329
|
import { voidVue } from '@void/vue/plugin';
|
|
3330
|
-
import { fate } from 'vue-fate/vite';
|
|
3331
3330
|
import { defineConfig } from 'vite-plus';
|
|
3332
3331
|
import { voidPlugin } from 'void';
|
|
3332
|
+
import { fate } from 'vue-fate/vite';
|
|
3333
3333
|
|
|
3334
3334
|
export default defineConfig({
|
|
3335
3335
|
plugins: [
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Function: alias()
|
|
2
|
+
|
|
3
|
+
## Call Signature
|
|
4
|
+
|
|
5
|
+
> **alias**\<`V`\>(`view`): [`AliasedView`](../type-aliases/AliasedView.md)\<`V`\>
|
|
6
|
+
|
|
7
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:15
|
|
8
|
+
|
|
9
|
+
Select a same-entity view under a named ref.
|
|
10
|
+
|
|
11
|
+
### Type Parameters
|
|
12
|
+
|
|
13
|
+
#### V
|
|
14
|
+
|
|
15
|
+
`V` *extends* `View`\<`any`, `any`\>
|
|
16
|
+
|
|
17
|
+
### Parameters
|
|
18
|
+
|
|
19
|
+
#### view
|
|
20
|
+
|
|
21
|
+
`V`
|
|
22
|
+
|
|
23
|
+
### Returns
|
|
24
|
+
|
|
25
|
+
[`AliasedView`](../type-aliases/AliasedView.md)\<`V`\>
|
|
26
|
+
|
|
27
|
+
## Call Signature
|
|
28
|
+
|
|
29
|
+
> **alias**\<`Field`, `S`\>(`field`, `selection`): [`AliasedSelection`](../type-aliases/AliasedSelection.md)\<`Field`, `S`\>
|
|
30
|
+
|
|
31
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:17
|
|
32
|
+
|
|
33
|
+
Select a schema field under a different result name, with its own arguments.
|
|
34
|
+
|
|
35
|
+
### Type Parameters
|
|
36
|
+
|
|
37
|
+
#### Field
|
|
38
|
+
|
|
39
|
+
`Field` *extends* `string`
|
|
40
|
+
|
|
41
|
+
#### S
|
|
42
|
+
|
|
43
|
+
`S`
|
|
44
|
+
|
|
45
|
+
### Parameters
|
|
46
|
+
|
|
47
|
+
#### field
|
|
48
|
+
|
|
49
|
+
`Field`
|
|
50
|
+
|
|
51
|
+
#### selection
|
|
52
|
+
|
|
53
|
+
`S`
|
|
54
|
+
|
|
55
|
+
### Returns
|
|
56
|
+
|
|
57
|
+
[`AliasedSelection`](../type-aliases/AliasedSelection.md)\<`Field`, `S`\>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: clientRoot()
|
|
2
|
+
|
|
3
|
+
> **clientRoot**\<`Result`, `Type`, `Args`\>(`type`): `RootDefinition`\<`Type`, `Result`, `Args`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/index.d.mts:67
|
|
6
|
+
|
|
7
|
+
Defines a root query for an entity type, capturing the response shape.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### Result
|
|
12
|
+
|
|
13
|
+
`Result`
|
|
14
|
+
|
|
15
|
+
### Type
|
|
16
|
+
|
|
17
|
+
`Type` *extends* `string`
|
|
18
|
+
|
|
19
|
+
### Args
|
|
20
|
+
|
|
21
|
+
`Args` = `AnyRecord`
|
|
22
|
+
|
|
23
|
+
## Parameters
|
|
24
|
+
|
|
25
|
+
### type
|
|
26
|
+
|
|
27
|
+
`Type`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
`RootDefinition`\<`Type`, `Result`, `Args`\>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Function: createClient()
|
|
2
|
+
|
|
3
|
+
> **createClient**\<`T`, `HydrationScope`\>(`options`): `FateClient`\<`T`\[`0`\], `T`\[`1`\], `HydrationScope`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1287
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### T
|
|
10
|
+
|
|
11
|
+
`T` *extends* \[`FateRoots`, `FateMutations`\] = \[`Record`\<`never`, `RootDefinition`\<`any`, `any`, `AnyRecord`\>\>, `Record`\<`never`, `MutationDefinition`\<`any`, `any`, `any`\>\>\]
|
|
12
|
+
|
|
13
|
+
### HydrationScope
|
|
14
|
+
|
|
15
|
+
`HydrationScope` *extends* `string` = `string`
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### options
|
|
20
|
+
|
|
21
|
+
`FateClientOptions`\<`T`\[`0`\], `T`\[`1`\], `HydrationScope`\>
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`FateClient`\<`T`\[`0`\], `T`\[`1`\], `HydrationScope`\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: createGraphQLTransport()
|
|
2
|
+
|
|
3
|
+
> **createGraphQLTransport**\<`Mutations`\>(`__namedParameters`): `Transport`\<`Mutations`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/graphqlTransport-D\_Nmg2Cy.d.mts:89
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### Mutations
|
|
10
|
+
|
|
11
|
+
`Mutations` *extends* `TransportMutations` = `EmptyTransportMutations`
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
### \_\_namedParameters
|
|
16
|
+
|
|
17
|
+
[`GraphQLTransportOptions`](../type-aliases/GraphQLTransportOptions.md)\<`Mutations`\>
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`Transport`\<`Mutations`\>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Function: createHTTPTransport()
|
|
2
|
+
|
|
3
|
+
> **createHTTPTransport**\<`API`, `Mutations`\>(`__namedParameters`): `Transport`\<`Mutations`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/index.d.mts:53
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### API
|
|
10
|
+
|
|
11
|
+
`API` *extends* `FateAPIShape`
|
|
12
|
+
|
|
13
|
+
### Mutations
|
|
14
|
+
|
|
15
|
+
`Mutations` *extends* `TransportMutations` = `MutationMapFromAPI`\<`API`\>
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
### \_\_namedParameters
|
|
20
|
+
|
|
21
|
+
#### eventSource?
|
|
22
|
+
|
|
23
|
+
`EventSourceConstructor`
|
|
24
|
+
|
|
25
|
+
#### fetch?
|
|
26
|
+
|
|
27
|
+
`FetchLike`
|
|
28
|
+
|
|
29
|
+
#### headers?
|
|
30
|
+
|
|
31
|
+
`HeadersFactory`
|
|
32
|
+
|
|
33
|
+
#### live?
|
|
34
|
+
|
|
35
|
+
`boolean` \| `LiveConnector`
|
|
36
|
+
|
|
37
|
+
#### liveRetryMs?
|
|
38
|
+
|
|
39
|
+
`number`
|
|
40
|
+
|
|
41
|
+
#### liveUrl?
|
|
42
|
+
|
|
43
|
+
`string` \| `URL`
|
|
44
|
+
|
|
45
|
+
#### url
|
|
46
|
+
|
|
47
|
+
`string` \| `URL`
|
|
48
|
+
|
|
49
|
+
## Returns
|
|
50
|
+
|
|
51
|
+
`Transport`\<`Mutations`\>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Function: createTRPCTransport()
|
|
2
|
+
|
|
3
|
+
> **createTRPCTransport**\<`AppRouter`, `Mutations`\>(`__namedParameters`): `Transport`\<`MutationMapFromResolvers`\<`Mutations`\>\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:932
|
|
6
|
+
|
|
7
|
+
Builds a `Transport` backed by a tRPC client using the configured resolvers
|
|
8
|
+
for by-id queries, lists, and mutations.
|
|
9
|
+
|
|
10
|
+
## Type Parameters
|
|
11
|
+
|
|
12
|
+
### AppRouter
|
|
13
|
+
|
|
14
|
+
`AppRouter` *extends* `AnyRouter`
|
|
15
|
+
|
|
16
|
+
### Mutations
|
|
17
|
+
|
|
18
|
+
`Mutations` *extends* `TRPCMutationResolvers`\<`AppRouter`\> = `EmptyMutationResolvers`\<`AppRouter`\>
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
### \_\_namedParameters
|
|
23
|
+
|
|
24
|
+
#### byId
|
|
25
|
+
|
|
26
|
+
`TRPCByIdResolvers`\<`AppRouter`\>
|
|
27
|
+
|
|
28
|
+
#### client
|
|
29
|
+
|
|
30
|
+
`TRPCClient`\<`AppRouter`\>
|
|
31
|
+
|
|
32
|
+
#### lists?
|
|
33
|
+
|
|
34
|
+
`TRPCListResolvers`\<`AppRouter`\>
|
|
35
|
+
|
|
36
|
+
#### mutateDurably?
|
|
37
|
+
|
|
38
|
+
\<`K`\>(`proc`, `input`, `select`, `identity`, `selectionArgs?`) => `Promise`\<`MutationMapFromResolvers`\<`Mutations`\>\[`K`\]\[`"output"`\]\>
|
|
39
|
+
|
|
40
|
+
#### mutations?
|
|
41
|
+
|
|
42
|
+
`Mutations`
|
|
43
|
+
|
|
44
|
+
#### queries?
|
|
45
|
+
|
|
46
|
+
`TRPCQueryResolvers`\<`AppRouter`\>
|
|
47
|
+
|
|
48
|
+
## Returns
|
|
49
|
+
|
|
50
|
+
`Transport`\<`MutationMapFromResolvers`\<`Mutations`\>\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Function: defer()
|
|
2
|
+
|
|
3
|
+
> **defer**\<`S`\>(`selection`): `DeferredSelection`\<`S`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/index.d.mts:7
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### S
|
|
10
|
+
|
|
11
|
+
`S`
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
### selection
|
|
16
|
+
|
|
17
|
+
`S`
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`DeferredSelection`\<`S`\>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Function: graphqlMutation()
|
|
2
|
+
|
|
3
|
+
> **graphqlMutation**\<`T`, `Input`, `Output`\>(`entity`, `options`): [`GraphQLMutationDefinition`](../type-aliases/GraphQLMutationDefinition.md)\<`T`, `Input`, `Output`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/graphqlTransport-D\_Nmg2Cy.d.mts:78
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### T
|
|
10
|
+
|
|
11
|
+
`T` *extends* `Entity`
|
|
12
|
+
|
|
13
|
+
### Input
|
|
14
|
+
|
|
15
|
+
`Input`
|
|
16
|
+
|
|
17
|
+
### Output
|
|
18
|
+
|
|
19
|
+
`Output`
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
### entity
|
|
24
|
+
|
|
25
|
+
`T`\[`"__typename"`\]
|
|
26
|
+
|
|
27
|
+
### options
|
|
28
|
+
|
|
29
|
+
#### field
|
|
30
|
+
|
|
31
|
+
`string`
|
|
32
|
+
|
|
33
|
+
#### inputArg?
|
|
34
|
+
|
|
35
|
+
`string` \| `false`
|
|
36
|
+
|
|
37
|
+
## Returns
|
|
38
|
+
|
|
39
|
+
[`GraphQLMutationDefinition`](../type-aliases/GraphQLMutationDefinition.md)\<`T`, `Input`, `Output`\>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Function: mutation()
|
|
2
|
+
|
|
3
|
+
> **mutation**\<`T`, `I`, `R`\>(`entity`): `MutationDefinition`\<`T`, `I`, `R`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1294
|
|
6
|
+
|
|
7
|
+
Defines a mutation for a given entity type, preserving the input and output
|
|
8
|
+
types for transports.
|
|
9
|
+
|
|
10
|
+
## Type Parameters
|
|
11
|
+
|
|
12
|
+
### T
|
|
13
|
+
|
|
14
|
+
`T` *extends* `Entity`
|
|
15
|
+
|
|
16
|
+
### I
|
|
17
|
+
|
|
18
|
+
`I`
|
|
19
|
+
|
|
20
|
+
### R
|
|
21
|
+
|
|
22
|
+
`R`
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
### entity
|
|
27
|
+
|
|
28
|
+
`T`\[`"__typename"`\]
|
|
29
|
+
|
|
30
|
+
## Returns
|
|
31
|
+
|
|
32
|
+
`MutationDefinition`\<`T`, `I`, `R`\>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Function: view()
|
|
2
|
+
|
|
3
|
+
> **view**\<`T`\>(): \{\<`S`\>(`select`): `View`\<`T`, `MutableSelection`\<`T`, `S`\>\>; \<`P`, `S`\>(`select`): [`ParameterizedView`](../type-aliases/ParameterizedView.md)\<`T`, `P`, `MutableSelection`\<`T`, `S`\>\>; \}
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/index.d.mts:90
|
|
6
|
+
|
|
7
|
+
Creates a reusable view for an object using the declared selection.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### T
|
|
12
|
+
|
|
13
|
+
`T` *extends* `Entity`
|
|
14
|
+
|
|
15
|
+
## Returns
|
|
16
|
+
|
|
17
|
+
\{\<`S`\>(`select`): `View`\<`T`, `MutableSelection`\<`T`, `S`\>\>; \<`P`, `S`\>(`select`): [`ParameterizedView`](../type-aliases/ParameterizedView.md)\<`T`, `P`, `MutableSelection`\<`T`, `S`\>\>; \}
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
const PostView = view<Post>()({
|
|
23
|
+
id: true,
|
|
24
|
+
title: true,
|
|
25
|
+
});
|
|
26
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Function: when()
|
|
2
|
+
|
|
3
|
+
> **when**\<`C`, `S`\>(`condition`, `selection`): [`ConditionalSelection`](../type-aliases/ConditionalSelection.md)\<`C`, `S`\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1379
|
|
6
|
+
|
|
7
|
+
Include a field or named fragment only when the condition is true.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### C
|
|
12
|
+
|
|
13
|
+
`C` *extends* `boolean`
|
|
14
|
+
|
|
15
|
+
### S
|
|
16
|
+
|
|
17
|
+
`S`
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
### condition
|
|
22
|
+
|
|
23
|
+
`C`
|
|
24
|
+
|
|
25
|
+
### selection
|
|
26
|
+
|
|
27
|
+
`S`
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
[`ConditionalSelection`](../type-aliases/ConditionalSelection.md)\<`C`, `S`\>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Interface: PersistenceSession
|
|
2
|
+
|
|
3
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:810
|
|
4
|
+
|
|
5
|
+
User-facing observability and lifecycle of an attached persistence integration.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### ready
|
|
10
|
+
|
|
11
|
+
> `readonly` **ready**: `Promise`\<`void`\>
|
|
12
|
+
|
|
13
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:816
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### clearCache()
|
|
18
|
+
|
|
19
|
+
> **clearCache**(): `Promise`\<`void`\>
|
|
20
|
+
|
|
21
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:811
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`void`\>
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### discard()
|
|
30
|
+
|
|
31
|
+
> **discard**(`id`): `Promise`\<`void`\>
|
|
32
|
+
|
|
33
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:812
|
|
34
|
+
|
|
35
|
+
#### Parameters
|
|
36
|
+
|
|
37
|
+
##### id
|
|
38
|
+
|
|
39
|
+
`string`
|
|
40
|
+
|
|
41
|
+
#### Returns
|
|
42
|
+
|
|
43
|
+
`Promise`\<`void`\>
|
|
44
|
+
|
|
45
|
+
***
|
|
46
|
+
|
|
47
|
+
### dispose()
|
|
48
|
+
|
|
49
|
+
> **dispose**(): `void`
|
|
50
|
+
|
|
51
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:813
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`void`
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### flush()
|
|
60
|
+
|
|
61
|
+
> **flush**(): `Promise`\<`void`\>
|
|
62
|
+
|
|
63
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:814
|
|
64
|
+
|
|
65
|
+
#### Returns
|
|
66
|
+
|
|
67
|
+
`Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
71
|
+
### getSnapshot()
|
|
72
|
+
|
|
73
|
+
> **getSnapshot**(): [`PersistenceSnapshot`](../type-aliases/PersistenceSnapshot.md)
|
|
74
|
+
|
|
75
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:815
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
[`PersistenceSnapshot`](../type-aliases/PersistenceSnapshot.md)
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### retry()
|
|
84
|
+
|
|
85
|
+
> **retry**(): `void`
|
|
86
|
+
|
|
87
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:817
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`void`
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
95
|
+
### subscribe()
|
|
96
|
+
|
|
97
|
+
> **subscribe**(`listener`): () => `void`
|
|
98
|
+
|
|
99
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:818
|
|
100
|
+
|
|
101
|
+
#### Parameters
|
|
102
|
+
|
|
103
|
+
##### listener
|
|
104
|
+
|
|
105
|
+
() => `void`
|
|
106
|
+
|
|
107
|
+
#### Returns
|
|
108
|
+
|
|
109
|
+
() => `void`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Type Alias: AliasedSelection\<Field, S\>
|
|
2
|
+
|
|
3
|
+
> **AliasedSelection**\<`Field`, `S`\> = `Readonly`\<\{ `[AliasTag]`: `true`; `field`: `Field`; `selection`: `S`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:9
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### Field
|
|
10
|
+
|
|
11
|
+
`Field` *extends* `string` = `string`
|
|
12
|
+
|
|
13
|
+
### S
|
|
14
|
+
|
|
15
|
+
`S` = `unknown`
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Type Alias: AliasedView\<V\>
|
|
2
|
+
|
|
3
|
+
> **AliasedView**\<`V`\> = `Readonly`\<\{ `[FragmentAliasTag]`: `true`; `view`: `V`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:5
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### V
|
|
10
|
+
|
|
11
|
+
`V` *extends* `View`\<`any`, `any`\> = `View`\<`any`, `any`\>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Type Alias: ConditionalSelection\<C, S\>
|
|
2
|
+
|
|
3
|
+
> **ConditionalSelection**\<`C`, `S`\> = `Readonly`\<\{ `[ConditionTag]`: `true`; `condition`: `C`; `selection`: `S`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1373
|
|
6
|
+
|
|
7
|
+
## Type Parameters
|
|
8
|
+
|
|
9
|
+
### C
|
|
10
|
+
|
|
11
|
+
`C` *extends* `boolean` = `boolean`
|
|
12
|
+
|
|
13
|
+
### S
|
|
14
|
+
|
|
15
|
+
`S` = `unknown`
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Type Alias: ConnectionRef\<TName\>
|
|
2
|
+
|
|
3
|
+
> **ConnectionRef**\<`TName`\> = `Readonly`\<\{ `items`: `ReadonlyArray`\<\{ `cursor?`: `string`; `node`: [`ViewRef`](ViewRef.md)\<`TName`\>; \}\>; `pagination?`: [`Pagination`](Pagination.md); \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1498
|
|
6
|
+
|
|
7
|
+
Ref for a connection, including pagination metadata.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### TName
|
|
12
|
+
|
|
13
|
+
`TName` *extends* `string`
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Type Alias: Deferred\<T\>
|
|
2
|
+
|
|
3
|
+
> **Deferred**\<`T`\> = `Readonly`\<\{ `[DeferredTag]`: `DeferredMetadata`; \}\> & `object`
|
|
4
|
+
|
|
5
|
+
Defined in: fate/lib/types-CNeg0z20.d.mts:1518
|
|
6
|
+
|
|
7
|
+
A deferred value returned from a masked view. Existing view hooks resolve it when read.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### T
|
|
12
|
+
|
|
13
|
+
`T`
|
|
14
|
+
|
|
15
|
+
## Type Declaration
|
|
16
|
+
|
|
17
|
+
### \[\_\_\_FateDeferredBrand\]
|
|
18
|
+
|
|
19
|
+
> `readonly` **\[\_\_\_FateDeferredBrand\]**: `T`
|