react-fate 1.3.3 → 1.5.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 +326 -0
- package/docs/api/functions/FateClient.md +1 -1
- 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 +5 -1
- package/docs/api/functions/defer.md +1 -1
- package/docs/api/functions/graphqlMutation.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/useFateClient.md +1 -1
- package/docs/api/functions/useListView.md +1 -1
- package/docs/api/functions/useLiveListView.md +1 -1
- package/docs/api/functions/useLiveView.md +2 -2
- package/docs/api/functions/useRequest.md +2 -2
- package/docs/api/functions/useView.md +3 -3
- package/docs/api/functions/view.md +1 -1
- package/docs/api/index.md +6 -0
- package/docs/api/interfaces/Persistence.md +23 -0
- package/docs/api/interfaces/PersistenceSession.md +109 -0
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Deferred.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.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 +19 -11
- 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/Pagination.md +5 -5
- package/docs/api/type-aliases/PersistenceSnapshot.md +5 -0
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/variables/toEntityId.md +1 -1
- package/docs/guide/getting-started.md +2 -0
- package/docs/guide/persistence.md +323 -0
- package/lib/cli.d.mts +1 -1
- package/lib/client.d.mts +0 -1
- package/lib/index.d.mts +3 -7
- package/lib/index.mjs +3 -2
- package/lib/vite.d.mts +0 -1
- package/package.json +7 -7
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Interface: PersistenceSession
|
|
2
|
+
|
|
3
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1474
|
|
4
|
+
|
|
5
|
+
Observability and lifecycle of an attached persistence integration.
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
### ready
|
|
10
|
+
|
|
11
|
+
> `readonly` **ready**: `Promise`\<`void`\>
|
|
12
|
+
|
|
13
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1486
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### clearCache()
|
|
18
|
+
|
|
19
|
+
> **clearCache**(): `Promise`\<`void`\>
|
|
20
|
+
|
|
21
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1477
|
|
22
|
+
|
|
23
|
+
#### Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`void`\>
|
|
26
|
+
|
|
27
|
+
***
|
|
28
|
+
|
|
29
|
+
### discard()
|
|
30
|
+
|
|
31
|
+
> **discard**(`id`): `Promise`\<`void`\>
|
|
32
|
+
|
|
33
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1478
|
|
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: packages/fate/lib/transport-DqjhjLfC.d.mts:1479
|
|
52
|
+
|
|
53
|
+
#### Returns
|
|
54
|
+
|
|
55
|
+
`void`
|
|
56
|
+
|
|
57
|
+
***
|
|
58
|
+
|
|
59
|
+
### flush()
|
|
60
|
+
|
|
61
|
+
> **flush**(): `Promise`\<`void`\>
|
|
62
|
+
|
|
63
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1482
|
|
64
|
+
|
|
65
|
+
#### Returns
|
|
66
|
+
|
|
67
|
+
`Promise`\<`void`\>
|
|
68
|
+
|
|
69
|
+
***
|
|
70
|
+
|
|
71
|
+
### getSnapshot()
|
|
72
|
+
|
|
73
|
+
> **getSnapshot**(): [`PersistenceSnapshot`](../type-aliases/PersistenceSnapshot.md)
|
|
74
|
+
|
|
75
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1483
|
|
76
|
+
|
|
77
|
+
#### Returns
|
|
78
|
+
|
|
79
|
+
[`PersistenceSnapshot`](../type-aliases/PersistenceSnapshot.md)
|
|
80
|
+
|
|
81
|
+
***
|
|
82
|
+
|
|
83
|
+
### retry()
|
|
84
|
+
|
|
85
|
+
> **retry**(): `void`
|
|
86
|
+
|
|
87
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1489
|
|
88
|
+
|
|
89
|
+
#### Returns
|
|
90
|
+
|
|
91
|
+
`void`
|
|
92
|
+
|
|
93
|
+
***
|
|
94
|
+
|
|
95
|
+
### subscribe()
|
|
96
|
+
|
|
97
|
+
> **subscribe**(`listener`): () => `void`
|
|
98
|
+
|
|
99
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1490
|
|
100
|
+
|
|
101
|
+
#### Parameters
|
|
102
|
+
|
|
103
|
+
##### listener
|
|
104
|
+
|
|
105
|
+
() => `void`
|
|
106
|
+
|
|
107
|
+
#### Returns
|
|
108
|
+
|
|
109
|
+
() => `void`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **ConnectionRef**\<`TName`\> = `Readonly`\<\{ `items`: `ReadonlyArray`\<\{ `cursor?`: `string`; `node`: [`ViewRef`](ViewRef.md)\<`TName`\>; \}\>; `pagination?`: [`Pagination`](Pagination.md); \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:743
|
|
6
6
|
|
|
7
7
|
Ref for a connection, including pagination metadata.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Deferred**\<`T`\> = `Readonly`\<\{ `[DeferredTag]`: `DeferredMetadata`; \}\> & `object`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:763
|
|
6
6
|
|
|
7
7
|
A deferred value returned from a masked view. Existing view hooks resolve it when read.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **FateDehydratedState**\<`Scope`\> = `Readonly`\<\{ `[hydrationScopeBrand]?`: `Scope`; `data`: `FateSerializedValue`; `scope`: `Scope`; `version`: `1`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1163
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **GraphQLMutationDefinition**\<`T`, `Input`, `Output`\> = `Readonly`\<\{ `__fateGraphQLMutation?`: \{ `input`: `Input`; `output`: `Output`; \}; `entity`: `T`\[`"__typename"`\]; `field`: `string`; `inputArg?`: `false` \| `string`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
5
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:19
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **GraphQLMutationInput**\<`Definition`\> = `Definition` *extends* [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\<`any`, infer Input, `any`\> ? `Input` : `never`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
5
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:28
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **GraphQLMutationMap**\<`Mutations`\> = `Mutations` *extends* `Record`\<`string`, [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\> ? `{ [K in keyof Mutations]: { input: GraphQLMutationInput<Mutations[K]>; output: GraphQLMutationOutput<Mutations[K]> } }` : `EmptyTransportMutations`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
5
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:30
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **GraphQLMutationOutput**\<`Definition`\> = `Definition` *extends* [`GraphQLMutationDefinition`](GraphQLMutationDefinition.md)\<`any`, `any`, infer Output\> ? `Output` : `never`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
5
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:29
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **GraphQLTransportOptions**\<`Mutations`\> = `object`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
5
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:45
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -16,7 +16,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:46
|
|
|
16
16
|
|
|
17
17
|
> `optional` **decodeNodeId?**: (`type`, `id`) => `string` \| `number`
|
|
18
18
|
|
|
19
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
19
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:46
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
@@ -38,7 +38,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:47
|
|
|
38
38
|
|
|
39
39
|
> `optional` **encodeNodeId?**: (`type`, `id`) => `string` \| `number`
|
|
40
40
|
|
|
41
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
41
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:47
|
|
42
42
|
|
|
43
43
|
#### Parameters
|
|
44
44
|
|
|
@@ -60,7 +60,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:48
|
|
|
60
60
|
|
|
61
61
|
> `optional` **eventSource?**: `EventSourceConstructor`
|
|
62
62
|
|
|
63
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
63
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:48
|
|
64
64
|
|
|
65
65
|
***
|
|
66
66
|
|
|
@@ -68,7 +68,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:49
|
|
|
68
68
|
|
|
69
69
|
> `optional` **fetch?**: `FetchLike`
|
|
70
70
|
|
|
71
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
71
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:49
|
|
72
72
|
|
|
73
73
|
***
|
|
74
74
|
|
|
@@ -76,7 +76,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:50
|
|
|
76
76
|
|
|
77
77
|
> `optional` **headers?**: `HeadersFactory`
|
|
78
78
|
|
|
79
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
79
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:50
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
@@ -84,7 +84,15 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:51
|
|
|
84
84
|
|
|
85
85
|
> `optional` **live?**: `boolean` \| `GraphQLLiveOptions`
|
|
86
86
|
|
|
87
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
87
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:51
|
|
88
|
+
|
|
89
|
+
***
|
|
90
|
+
|
|
91
|
+
### mutateDurably?
|
|
92
|
+
|
|
93
|
+
> `optional` **mutateDurably?**: `Transport`\<`Mutations`\>\[`"mutateDurably"`\]
|
|
94
|
+
|
|
95
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:52
|
|
88
96
|
|
|
89
97
|
***
|
|
90
98
|
|
|
@@ -92,7 +100,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:52
|
|
|
92
100
|
|
|
93
101
|
> `optional` **mutations?**: `Record`\<`Extract`\<keyof `Mutations`, `string`\>, `GraphQLMutationRuntimeConfig`\>
|
|
94
102
|
|
|
95
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
103
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:53
|
|
96
104
|
|
|
97
105
|
***
|
|
98
106
|
|
|
@@ -100,7 +108,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:53
|
|
|
100
108
|
|
|
101
109
|
> `optional` **roots?**: `Record`\<`string`, `GraphQLRootConfig`\>
|
|
102
110
|
|
|
103
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
111
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:54
|
|
104
112
|
|
|
105
113
|
***
|
|
106
114
|
|
|
@@ -108,7 +116,7 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:54
|
|
|
108
116
|
|
|
109
117
|
> **types**: `ReadonlyArray`\<`Omit`\<`TypeConfig`, `"getId"`\> & `Partial`\<`Pick`\<`TypeConfig`, `"getId"`\>\>\>
|
|
110
118
|
|
|
111
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
119
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:55
|
|
112
120
|
|
|
113
121
|
***
|
|
114
122
|
|
|
@@ -116,4 +124,4 @@ Defined in: packages/fate/lib/graphqlTransport-DskuXeUP.d.mts:55
|
|
|
116
124
|
|
|
117
125
|
> **url**: `string` \| `URL`
|
|
118
126
|
|
|
119
|
-
Defined in: packages/fate/lib/graphqlTransport-
|
|
127
|
+
Defined in: packages/fate/lib/graphqlTransport-DGLYyRxL.d.mts:56
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **HydrateOptions** = `Readonly`\<\{ `merge?`: `"preserve-existing"` \| `"replace"`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1170
|
|
6
6
|
|
|
7
7
|
Controls how `FateClient.hydrate()` reconciles a snapshot with browser cache state.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **HydrationLimits** = `Readonly`\<\{ `maxCollectionLength`: `number`; `maxNodes`: `number`; `maxStringLength`: `number`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1180
|
|
6
6
|
|
|
7
7
|
Resource limits applied while encoding and decoding hydration snapshots.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Pagination** = `object`
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:736
|
|
6
6
|
|
|
7
7
|
Pagination state returned alongside connection lists.
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ Pagination state returned alongside connection lists.
|
|
|
12
12
|
|
|
13
13
|
> **hasNext**: `boolean`
|
|
14
14
|
|
|
15
|
-
Defined in: packages/fate/lib/transport-
|
|
15
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:737
|
|
16
16
|
|
|
17
17
|
***
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ Defined in: packages/fate/lib/transport-DhaVVq4P.d.mts:1102
|
|
|
20
20
|
|
|
21
21
|
> **hasPrevious**: `boolean`
|
|
22
22
|
|
|
23
|
-
Defined in: packages/fate/lib/transport-
|
|
23
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:738
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ Defined in: packages/fate/lib/transport-DhaVVq4P.d.mts:1103
|
|
|
28
28
|
|
|
29
29
|
> `optional` **nextCursor?**: `string`
|
|
30
30
|
|
|
31
|
-
Defined in: packages/fate/lib/transport-
|
|
31
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:739
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
@@ -36,4 +36,4 @@ Defined in: packages/fate/lib/transport-DhaVVq4P.d.mts:1104
|
|
|
36
36
|
|
|
37
37
|
> `optional` **previousCursor?**: `string`
|
|
38
38
|
|
|
39
|
-
Defined in: packages/fate/lib/transport-
|
|
39
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:740
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: PersistenceSnapshot
|
|
2
|
+
|
|
3
|
+
> **PersistenceSnapshot** = `Readonly`\<\{ `error?`: `Error`; `mutations`: `ReadonlyArray`\<`PersistedMutationStatus`\>; `status`: `"restoring"` \| `"ready"` \| `"error"` \| `"disposed"`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:1465
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **ViewRef**\<`TName`\> = `Readonly`\<\{ `__typename`: `TName`; `[ViewsTag]`: `Set`\<`string`\>; `id`: `string` \| `number`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: packages/fate/lib/transport-
|
|
5
|
+
Defined in: packages/fate/lib/transport-DqjhjLfC.d.mts:712
|
|
6
6
|
|
|
7
7
|
Reference to a normalized entity instance that can be resolved against one or more view tags.
|
|
8
8
|
|
|
@@ -8,6 +8,8 @@ Create a new fate app with Vite+:
|
|
|
8
8
|
vp create fate my-app
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Explore the [fate stack](https://stack.fate.technology) to see the tools included in your new project.
|
|
12
|
+
|
|
11
13
|
The template selector can create a React or Vue client for a Void app with Drizzle, a tRPC app with Drizzle or Prisma, a GraphQL app with Prisma, or a fate client for an existing GraphQL server. React is the default UI framework; pass `--framework vue` or choose Vue in the template selector to create a Vue app. The template sources live in the fate repo under [`packages/create-fate/templates/fate`](https://github.com/nkzw-tech/fate/tree/main/packages/create-fate/templates/fate). They feature modern tools to deliver an incredibly fast development experience.
|
|
12
14
|
|
|
13
15
|
## Manual Installation
|