@apollion-dsi/relay 0.27.1 → 0.27.3
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 +42 -42
- package/lib/commitMutation/commitMutation.d.ts +15 -15
- package/lib/commitMutation/index.d.ts +4 -4
- package/lib/index.d.ts +9 -9
- package/lib/mutationUtils/index.d.ts +5 -5
- package/lib/mutationUtils/mutationUtils.d.ts +60 -60
- package/lib/relayArgsInterface/index.d.ts +3 -3
- package/lib/relayArgsInterface/relayArgsInterface.d.ts +79 -79
- package/lib/setupRelayEnvironment/executeEnvironment.d.ts +13 -13
- package/lib/setupRelayEnvironment/fetchQuery.d.ts +19 -19
- package/lib/setupRelayEnvironment/fetchWithRetries.d.ts +20 -20
- package/lib/setupRelayEnvironment/setupRelayEnvironment.d.ts +57 -57
- package/lib/setupRelayEnvironment/setupRelayEnvironment.helpers.d.ts +55 -55
- package/lib/setupRelayEnvironment/storage.d.ts +17 -17
- package/lib/setupRelayEnvironment/subscriptionHandler.d.ts +17 -17
- package/lib/useEnvironment/index.d.ts +5 -5
- package/lib/useEnvironment/useEnvironment.d.ts +16 -16
- package/package.json +6 -7
package/README.MD
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @apollion-dsi/relay
|
|
2
2
|
|
|
3
|
-
Helpers
|
|
4
|
-
|
|
5
|
-
upload
|
|
3
|
+
Helpers to configure and use **Relay** (`react-relay` / `relay-runtime`)
|
|
4
|
+
the Apollion DS way. Covers Environment creation with auth,
|
|
5
|
+
multipart upload, subscriptions via WebSocket, and session cookies.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@apollion-dsi/relay)
|
|
8
8
|
|
|
@@ -13,20 +13,20 @@ upload multipart, subscriptions via WebSocket e cookies de sessão.
|
|
|
13
13
|
- **graphql** 15.x
|
|
14
14
|
- **graphql-ws** 6.x (subscriptions)
|
|
15
15
|
- **fetch-multipart-graphql** (uploads)
|
|
16
|
-
- **js-cookie** (
|
|
16
|
+
- **js-cookie** (session)
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
yarn add @apollion-dsi/relay react@19.2.6
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
>
|
|
25
|
-
> `relay-compiler`
|
|
24
|
+
> To generate Relay artifacts, the consumer also needs
|
|
25
|
+
> `relay-compiler` as a dev dependency and a `relay.config.js` setup.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Basic usage
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
Create a Relay Environment for the application:
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
import { CreateRelayEnvironment } from '@apollion-dsi/relay';
|
|
@@ -36,7 +36,7 @@ export const { Environment } = new CreateRelayEnvironment({
|
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Then wrap the React tree with `RelayEnvironmentProvider`:
|
|
40
40
|
|
|
41
41
|
```tsx
|
|
42
42
|
import { RelayEnvironmentProvider } from 'react-relay';
|
|
@@ -48,72 +48,72 @@ import { App } from './app';
|
|
|
48
48
|
</RelayEnvironmentProvider>;
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
##
|
|
51
|
+
## Helper features
|
|
52
52
|
|
|
53
|
-
- **
|
|
54
|
-
|
|
55
|
-
- **Multipart uploads** (`fetch-multipart-graphql`) —
|
|
56
|
-
|
|
53
|
+
- **Authentication** in two modes: `Bearer` (JS token) or **httpOnly
|
|
54
|
+
cookie** (see below).
|
|
55
|
+
- **Multipart uploads** (`fetch-multipart-graphql`) — send files
|
|
56
|
+
directly in mutations.
|
|
57
57
|
- **Subscriptions** via `graphql-ws`.
|
|
58
|
-
- **
|
|
58
|
+
- Pluggable **network retry / refresh**.
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Authentication: Bearer vs. httpOnly cookie
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
The Environment supports two auth models via `authMode`.
|
|
63
63
|
|
|
64
|
-
### `authMode: 'bearer'` (default —
|
|
64
|
+
### `authMode: 'bearer'` (default — backwards compatible)
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
Reads the `sessionToken` from storage (`localStorage`/JS-readable `cookie`) and
|
|
67
|
+
injects `Authorization: Bearer <token>` into every request. Session
|
|
68
|
+
verification uses the `${authUrl}user/me` probe. Behavior is identical to
|
|
69
|
+
previous versions — existing consumers don't need to change anything.
|
|
70
70
|
|
|
71
71
|
```ts
|
|
72
72
|
new CreateRelayEnvironment({
|
|
73
73
|
url: 'https://api.example.com/graphql/',
|
|
74
74
|
authUrl: 'https://api.example.com/auth/',
|
|
75
|
-
useAuthorization: true, //
|
|
76
|
-
storageType: 'cookie', //
|
|
75
|
+
useAuthorization: true, // injects Bearer
|
|
76
|
+
storageType: 'cookie', // JS-readable cookie or 'localStorage'
|
|
77
77
|
});
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
### `authMode: 'cookie'` (
|
|
80
|
+
### `authMode: 'cookie'` (httpOnly cookie session — recommended for SPAs)
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
The secure model: the session token lives in an **httpOnly + SameSite**
|
|
83
|
+
cookie (invisible to JS, immune to XSS). The Environment does **not** read
|
|
84
|
+
the token or inject `Authorization` — `credentials: 'include'` (the default
|
|
85
|
+
in this mode) makes the browser attach the cookie automatically, including
|
|
86
|
+
cross-origin. On an auth error (e.g. 401), the refresh is fired as a `POST`
|
|
87
|
+
to `authUrl` with `credentials: 'include'` — **without** probing `user/me`.
|
|
88
88
|
|
|
89
89
|
```ts
|
|
90
90
|
new CreateRelayEnvironment({
|
|
91
91
|
url: 'https://api.example.com/graphql/',
|
|
92
|
-
authUrl: 'https://api.example.com/auth/refresh/', //
|
|
92
|
+
authUrl: 'https://api.example.com/auth/refresh/', // on-401 refresh target
|
|
93
93
|
authMode: 'cookie',
|
|
94
94
|
redirectOnError: true,
|
|
95
95
|
loginRoute: '/login',
|
|
96
96
|
});
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
Related options:
|
|
100
100
|
|
|
101
|
-
|
|
|
101
|
+
| Option | Default | What it does |
|
|
102
102
|
|---|---|---|
|
|
103
|
-
| `authMode` | `'bearer'` | `'bearer'` (token + header)
|
|
104
|
-
| `credentials` | cookie→`'include'`; bearer→
|
|
105
|
-
| `sessionCheckUrl` |
|
|
103
|
+
| `authMode` | `'bearer'` | `'bearer'` (token + header) or `'cookie'` (httpOnly). |
|
|
104
|
+
| `credentials` | cookie→`'include'`; bearer→omitted | `RequestCredentials` forwarded to the GraphQL and refresh fetches. Works in both modes. |
|
|
105
|
+
| `sessionCheckUrl` | mode-dependent | Overrides the probe URL; `false` disables the probe (auth error → direct logout, no extra request). |
|
|
106
106
|
|
|
107
107
|
## Scripts (workspace)
|
|
108
108
|
|
|
109
|
-
| Script |
|
|
109
|
+
| Script | What it does |
|
|
110
110
|
|---|---|
|
|
111
111
|
| `yarn workspace @apollion-dsi/relay run validate` | Lint + types + prettier + Jest + build. |
|
|
112
112
|
| `yarn workspace @apollion-dsi/relay run coverage` | Jest coverage. |
|
|
113
|
-
| `yarn workspace @apollion-dsi/relay run build` | esbuild + emit
|
|
113
|
+
| `yarn workspace @apollion-dsi/relay run build` | esbuild + types emit. |
|
|
114
114
|
| `yarn workspace @apollion-dsi/relay run audit-dependencies` | audit-ci. |
|
|
115
|
-
| `yarn workspace @apollion-dsi/relay run pretest` | `relay-compiler` (
|
|
115
|
+
| `yarn workspace @apollion-dsi/relay run pretest` | `relay-compiler` (generates `__generated__` before the tests). |
|
|
116
116
|
|
|
117
|
-
##
|
|
117
|
+
## License
|
|
118
118
|
|
|
119
119
|
MIT.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { MutationConfig, MutationParameters } from 'relay-runtime';
|
|
2
2
|
import { Environment } from 'relay-runtime/lib/store/RelayStoreTypes';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Promise-based wrapper around `relay-runtime`'s `commitMutation`.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `optimisticResponse`, `updater`, `cacheConfig` etc.,
|
|
11
|
-
*
|
|
6
|
+
* Relay's original `commitMutation` exposes mutation completion via the
|
|
7
|
+
* `onCompleted` and `onError` callbacks. This function encapsulates those
|
|
8
|
+
* callbacks in a `Promise`, allowing natural `async/await` usage in the
|
|
9
|
+
* consumer — which typically covers 95% of the cases. For flows that need
|
|
10
|
+
* `optimisticResponse`, `updater`, `cacheConfig` etc., all the remaining
|
|
11
|
+
* `MutationConfig` options are still accepted via `config`.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* The `onCompleted` and `onError` fields are omitted from `config` on purpose:
|
|
14
|
+
* they are managed internally to feed the Promise's resolve/reject.
|
|
15
15
|
*
|
|
16
|
-
* @typeParam T -
|
|
17
|
-
* tagged) —
|
|
16
|
+
* @typeParam T - Type generated by the Relay Compiler for the mutation
|
|
17
|
+
* (`graphql` tagged) — provides the shape of `variables` and `response`.
|
|
18
18
|
*
|
|
19
|
-
* @param environment -
|
|
19
|
+
* @param environment - Relay environment (usually the one exposed by
|
|
20
20
|
* `CreateRelayEnvironment`).
|
|
21
|
-
* @param config -
|
|
21
|
+
* @param config - Mutation configuration, without `onCompleted` and `onError`.
|
|
22
22
|
*
|
|
23
|
-
* @returns Promise
|
|
24
|
-
*
|
|
23
|
+
* @returns Promise that resolves with `T['response']` or rejects with the
|
|
24
|
+
* error returned by Relay.
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```tsx
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public barrel for the `commitMutation` module.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* via `@apollion-dsi/relay/commitMutation` (
|
|
6
|
-
*
|
|
4
|
+
* Re-exports the `commitMutation` function so consumers can import it
|
|
5
|
+
* via `@apollion-dsi/relay/commitMutation` (granular import, avoiding
|
|
6
|
+
* loading the rest of the package) or via `@apollion-dsi/relay` (root barrel).
|
|
7
7
|
*/
|
|
8
8
|
export * from './commitMutation';
|
package/lib/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public barrel for the `@apollion-dsi/relay` package.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (`CreateRelayEnvironment`),
|
|
6
|
-
* `useEnvironment`),
|
|
7
|
-
* `Sink`),
|
|
8
|
-
*
|
|
4
|
+
* Re-exports the package's public surface: the Environment factory
|
|
5
|
+
* (`CreateRelayEnvironment`), the Context/hook (`EnvironmentProvider` /
|
|
6
|
+
* `useEnvironment`), the configuration types (`RelayArgsInterface`,
|
|
7
|
+
* `Sink`), the mutation updater utilities and the Promise-based
|
|
8
|
+
* `commitMutation` wrapper.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* `@apollion-dsi/relay/<
|
|
12
|
-
*
|
|
10
|
+
* Each module can also be imported granularly via
|
|
11
|
+
* `@apollion-dsi/relay/<name>` when the consumer wants to load
|
|
12
|
+
* less code.
|
|
13
13
|
*/
|
|
14
14
|
export { default as CreateRelayEnvironment } from './setupRelayEnvironment/setupRelayEnvironment';
|
|
15
15
|
export * from './useEnvironment';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public barrel for the `mutationUtils` module.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (
|
|
6
|
-
* `@apollion-dsi/relay/mutationUtils` (granular)
|
|
7
|
-
* `@apollion-dsi/relay` (barrel
|
|
4
|
+
* Re-exports the helpers for writing Relay mutation `updater`s
|
|
5
|
+
* (lists, connections, optimistic responses). Importable via
|
|
6
|
+
* `@apollion-dsi/relay/mutationUtils` (granular) or via
|
|
7
|
+
* `@apollion-dsi/relay` (root barrel).
|
|
8
8
|
*/
|
|
9
9
|
export * from './mutationUtils';
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview
|
|
3
|
-
*
|
|
4
|
-
* `ConnectionHandler`
|
|
2
|
+
* @fileoverview Utilities for writing Relay mutation `updater`s
|
|
3
|
+
* declaratively, without having to manipulate `RecordProxy` /
|
|
4
|
+
* `ConnectionHandler` by hand in every common case.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
9
|
-
* -
|
|
10
|
-
* (
|
|
6
|
+
* Covers the most frequent scenarios:
|
|
7
|
+
* - inserting/removing items in lists (`linked records`);
|
|
8
|
+
* - inserting/removing edges in connections (Relay pagination);
|
|
9
|
+
* - copying scalar fields from a JS object to a `RecordProxy`
|
|
10
|
+
* (useful in optimistic responses).
|
|
11
11
|
*/
|
|
12
12
|
import { RecordProxy, RecordSourceSelectorProxy } from 'relay-runtime';
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
14
|
+
* Checks whether a value is a non-null object (to detect scalar
|
|
15
|
+
* fields vs. linked records in `copyObjScalarsToProxy`).
|
|
16
16
|
*/
|
|
17
17
|
export declare function isObject(obj: any): boolean;
|
|
18
|
-
/**
|
|
18
|
+
/** Arguments for `listRecordRemoveUpdater`. */
|
|
19
19
|
type ListRecordRemoveUpdaterOptions = {
|
|
20
20
|
parentId: string;
|
|
21
21
|
itemId: string;
|
|
22
22
|
parentFieldName: string;
|
|
23
23
|
store: RecordSourceSelectorProxy;
|
|
24
24
|
};
|
|
25
|
-
/**
|
|
25
|
+
/** Arguments for `listRecordAddUpdater`. */
|
|
26
26
|
type ListRecordAddUpdaterOptions = {
|
|
27
27
|
parentId: string;
|
|
28
28
|
item: Record<string, any>;
|
|
@@ -30,7 +30,7 @@ type ListRecordAddUpdaterOptions = {
|
|
|
30
30
|
parentFieldName: string;
|
|
31
31
|
store: RecordSourceSelectorProxy;
|
|
32
32
|
};
|
|
33
|
-
/**
|
|
33
|
+
/** Arguments for `optimisticConnectionUpdater`. */
|
|
34
34
|
type OptimisticConnectionUpdaterOptions = {
|
|
35
35
|
parentId: string;
|
|
36
36
|
store: RecordSourceSelectorProxy;
|
|
@@ -39,95 +39,95 @@ type OptimisticConnectionUpdaterOptions = {
|
|
|
39
39
|
customNode: RecordProxy;
|
|
40
40
|
itemType: string;
|
|
41
41
|
};
|
|
42
|
-
/**
|
|
42
|
+
/** Arguments for `connectionDeleteEdgeUpdater`. */
|
|
43
43
|
type ConnectionDeleteEdgeUpdaterOptions = {
|
|
44
44
|
parentId: string;
|
|
45
45
|
connectionName: string;
|
|
46
46
|
nodeId: string;
|
|
47
47
|
store: RecordSourceSelectorProxy;
|
|
48
48
|
};
|
|
49
|
-
/**
|
|
49
|
+
/** Arguments for `copyObjScalarsToProxy`. */
|
|
50
50
|
type CopyObjScalarsToProxyOptions = {
|
|
51
51
|
object: Record<string, any>;
|
|
52
52
|
proxy: RecordProxy;
|
|
53
53
|
};
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* Modern.
|
|
55
|
+
* Unique identifier generated once per module load,
|
|
56
|
+
* intended for the `clientMutationId` field expected by the Relay
|
|
57
|
+
* Modern pattern.
|
|
58
58
|
*/
|
|
59
59
|
export declare const ClientMutationID: string;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Removes an item from a `linked records` list on a parent.
|
|
62
62
|
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
63
|
+
* Uses `getLinkedRecords` + `setLinkedRecords` with a `dataID` filter.
|
|
64
|
+
* For paginated connections, prefer `connectionDeleteEdgeUpdater`.
|
|
65
65
|
*
|
|
66
|
-
* @param options.parentId - DataID
|
|
67
|
-
* @param options.itemId - DataID
|
|
68
|
-
* @param options.parentFieldName -
|
|
69
|
-
* @param options.store - `RecordSourceSelectorProxy`
|
|
66
|
+
* @param options.parentId - DataID of the parent that owns the linked field.
|
|
67
|
+
* @param options.itemId - DataID of the item to remove.
|
|
68
|
+
* @param options.parentFieldName - Name of the linked field on the parent.
|
|
69
|
+
* @param options.store - `RecordSourceSelectorProxy` received in the updater.
|
|
70
70
|
*/
|
|
71
71
|
export declare function listRecordRemoveUpdater({ parentId, itemId, parentFieldName, store, }: ListRecordRemoveUpdaterOptions): void;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Adds an item to the end of a `linked records` list.
|
|
74
74
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* Creates a new `RecordProxy` using `item.id` as the dataID and copies all
|
|
76
|
+
* fields from `item` to the new record (without validating types — scalars
|
|
77
|
+
* and linked refs both go through `setValue`).
|
|
78
78
|
*
|
|
79
|
-
* @param options.parentId - DataID
|
|
80
|
-
* @param options.item -
|
|
81
|
-
* @param options.type -
|
|
82
|
-
* @param options.parentFieldName -
|
|
83
|
-
* @param options.store - `RecordSourceSelectorProxy
|
|
79
|
+
* @param options.parentId - DataID of the parent.
|
|
80
|
+
* @param options.item - Object with the new record's fields (must have `id`).
|
|
81
|
+
* @param options.type - GraphQL type of the record (e.g. `'Todo'`).
|
|
82
|
+
* @param options.parentFieldName - Name of the linked field on the parent.
|
|
83
|
+
* @param options.store - The updater's `RecordSourceSelectorProxy`.
|
|
84
84
|
*/
|
|
85
85
|
export declare function listRecordAddUpdater({ parentId, item, type, parentFieldName, store, }: ListRecordAddUpdaterOptions): void;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* Inserts an edge into a paginated connection (Relay Connections spec).
|
|
88
88
|
*
|
|
89
|
-
* @param store - `RecordSourceSelectorProxy
|
|
90
|
-
* @param parentId - DataID
|
|
91
|
-
* @param connectionName -
|
|
92
|
-
* @param edge -
|
|
93
|
-
* @param before -
|
|
89
|
+
* @param store - The updater's `RecordSourceSelectorProxy`.
|
|
90
|
+
* @param parentId - DataID of the parent that owns the connection.
|
|
91
|
+
* @param connectionName - Connection name in the schema (`@connection(key: ...)`).
|
|
92
|
+
* @param edge - The edge's `RecordProxy`, already created by the caller.
|
|
93
|
+
* @param before - If `true`, inserts before the first edge (default `false`).
|
|
94
94
|
*/
|
|
95
95
|
export declare function connectionUpdater(store: RecordSourceSelectorProxy, parentId: string, connectionName: string, edge: RecordProxy, before?: boolean): void;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
* node
|
|
99
|
-
*
|
|
97
|
+
* Variant of `connectionUpdater` used in optimistic responses: creates the
|
|
98
|
+
* node and the edge "from scratch" out of a JS object, simulating what the
|
|
99
|
+
* server would return.
|
|
100
100
|
*
|
|
101
|
-
* @param options.parentId - DataID
|
|
101
|
+
* @param options.parentId - DataID of the parent.
|
|
102
102
|
* @param options.store - `RecordSourceSelectorProxy`.
|
|
103
|
-
* @param options.connectionName -
|
|
104
|
-
* @param options.item -
|
|
105
|
-
* @param options.customNode - `RecordProxy`
|
|
106
|
-
* @param options.itemType -
|
|
107
|
-
*
|
|
103
|
+
* @param options.connectionName - Connection name.
|
|
104
|
+
* @param options.item - Object with the new node's fields (must have `id`).
|
|
105
|
+
* @param options.customNode - Pre-created `RecordProxy` (optional, avoids creating via `item`).
|
|
106
|
+
* @param options.itemType - GraphQL type of the node (e.g. `'Todo'`); the edge
|
|
107
|
+
* will be created as `<itemType>Edge`.
|
|
108
108
|
*/
|
|
109
109
|
export declare function optimisticConnectionUpdater({ parentId, store, connectionName, item, customNode, itemType, }: OptimisticConnectionUpdaterOptions): void;
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
111
|
+
* Removes a node from a paginated connection by its `dataID`.
|
|
112
112
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
113
|
+
* Logs a `console.warn` if the connection is not found (usually
|
|
114
|
+
* means the `connectionName` is wrong).
|
|
115
115
|
*
|
|
116
|
-
* @param options.parentId - DataID
|
|
117
|
-
* @param options.connectionName -
|
|
118
|
-
* @param options.nodeId - DataID
|
|
116
|
+
* @param options.parentId - DataID of the parent.
|
|
117
|
+
* @param options.connectionName - Connection name.
|
|
118
|
+
* @param options.nodeId - DataID of the node to remove.
|
|
119
119
|
* @param options.store - `RecordSourceSelectorProxy`.
|
|
120
120
|
*/
|
|
121
121
|
export declare function connectionDeleteEdgeUpdater({ parentId, connectionName, nodeId, store, }: ConnectionDeleteEdgeUpdaterOptions): void;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* Copies the scalar fields of a JS object to a `RecordProxy`.
|
|
124
124
|
*
|
|
125
|
-
*
|
|
126
|
-
* record lists) —
|
|
125
|
+
* Ignores fields that are objects or arrays (linked records / linked
|
|
126
|
+
* record lists) — those must be handled with
|
|
127
127
|
* `setLinkedRecord`/`setLinkedRecords`.
|
|
128
128
|
*
|
|
129
|
-
* @param options.object -
|
|
130
|
-
* @param options.proxy - `RecordProxy
|
|
129
|
+
* @param options.object - Source JS object.
|
|
130
|
+
* @param options.proxy - Destination `RecordProxy`.
|
|
131
131
|
*/
|
|
132
132
|
export declare function copyObjScalarsToProxy({ object, proxy }: CopyObjScalarsToProxyOptions): void;
|
|
133
133
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Public barrel for the `relayArgsInterface` module.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `CreateRelayEnvironment`)
|
|
4
|
+
* Re-exports the `RelayArgsInterface` type (config accepted by
|
|
5
|
+
* `CreateRelayEnvironment`) and `Sink` (the Relay Observable interface).
|
|
6
6
|
*/
|
|
7
7
|
export * from './relayArgsInterface';
|