You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-**Compile-time safety**: Typos like `'createAcount'` are caught at build time
245
+
-**IDE autocomplete**: Full IntelliSense support for action names
246
+
-**Single source of truth**: Adding a new action to the registry automatically updates the type
247
+
-**No sync issues**: The type and implementation can never get out of sync
248
+
249
+
---
250
+
251
+
## 5. Built-in Actions
194
252
195
253
The execution engine provides these built-in actions that map to existing mutation hooks:
196
254
@@ -210,9 +268,9 @@ The execution engine provides these built-in actions that map to existing mutati
210
268
211
269
---
212
270
213
-
## 5. Mutation Execution Mechanism
271
+
## 6. Mutation Execution Mechanism
214
272
215
-
### 5.1 Compilation Phase
273
+
### 6.1 Compilation Phase
216
274
217
275
The Template Compiler transforms the declarative mutation array into the format required by `useChainedMutations`:
218
276
@@ -249,7 +307,7 @@ mutations: [
249
307
}
250
308
```
251
309
252
-
### 5.2 Loop Expansion
310
+
### 6.2 Loop Expansion
253
311
254
312
Loop mutations (`LoopMutation`) are expanded **per item**, meaning all steps for one item complete before moving to the next:
255
313
@@ -269,7 +327,7 @@ Loop mutations (`LoopMutation`) are expanded **per item**, meaning all steps for
269
327
4.tagBucket-1 (backup-2)
270
328
```
271
329
272
-
### 5.3 Execution Phase
330
+
### 6.3 Execution Phase
273
331
274
332
Execution is handled by `useChainedMutations`:
275
333
@@ -278,7 +336,7 @@ Execution is handled by `useChainedMutations`:
278
336
3.**Error Handling**: On failure, stops execution and enables retry
279
337
4.**Result Passing**: Previous results are available via `PreviousResults`
280
338
281
-
### 5.4 Accessing Previous Results
339
+
### 6.4 Accessing Previous Results
282
340
283
341
The `prev` parameter in variables resolvers provides access to completed mutation results:
284
342
@@ -305,7 +363,7 @@ variables: (form, prev) => ({
305
363
})
306
364
```
307
365
308
-
### 5.5 Conditional Execution
366
+
### 6.5 Conditional Execution
309
367
310
368
Use `when` to control whether a mutation executes:
311
369
@@ -332,7 +390,7 @@ Use `when` to control whether a mutation executes:
332
390
}
333
391
```
334
392
335
-
### 5.6 Label Templates
393
+
### 6.6 Label Templates
336
394
337
395
Loop mutation labels support template syntax for dynamic text:
338
396
@@ -356,22 +414,23 @@ Loop mutation labels support template syntax for dynamic text:
356
414
357
415
---
358
416
359
-
## 6. Runtime Context Injection
417
+
## 7. Runtime Context Injection
360
418
361
-
Some values are injected at runtime before form submission:
419
+
Runtime context fields (defined in `RuntimeContext` interface, see [Section 3.4](#34-runtime-context)) are injected into `FormData` before mutation execution.
362
420
363
-
| Field | Description | Source |
364
-
|-------|-------------|--------|
365
-
|`_sosApiAvailable`| Whether SOS API is available |`useCheckSOSAPIStatus`|
366
-
|`_existingAccountArn`| Selected existing account's role ARN | Account selection |
367
-
|`_existingAccountId`| Selected existing account's ID | Account selection |
368
-
|`_iamUserType`| 'create' or 'existing' | IAM user selection |
421
+
**Injection timing:**
422
+
1. User completes form input
423
+
2. System evaluates runtime conditions (SOS API status, account selection, etc.)
424
+
3. Context fields are merged into form data
425
+
4. Mutations execute with the complete `FormData`
369
426
370
-
These are prefixed with `_` to indicate they are system-injected, not user input.
427
+
**Convention:**
428
+
- All injected fields are prefixed with `_` to distinguish from user input
429
+
- Fields are fully typed - IDE autocomplete and compile-time checks are available
0 commit comments