Commit 481b874
committed
fix(relational-transformer): read related-table GSIs compatibly with aws-cdk-lib 2.260 (globalSecondaryIndexes no longer populated) [#3505]
aws-cdk-lib 2.260 renamed the private DynamoDB L2 Table field
`globalSecondaryIndexes`/`localSecondaryIndexes` to
`_globalSecondaryIndexes`/`_localSecondaryIndexes` (now ArrayBox-backed,
same `.some`/`.find`/`.length` surface and `{ indexName, keySchema }`
element shape). The transformer read the old names, yielding `undefined`
and `TypeError: Cannot read properties of undefined (reading 'some'/'find')`,
breaking 63 relational unit tests plus a conversation unit test.
Read the renamed field first, falling back to the public
`globalSecondaryIndexes` used by Amplify's managed-table construct, so the
duplicate-index-name dedupe is preserved (not disabled) for both table types.
Sites fixed:
- amplify-graphql-relational-transformer/src/resolvers.ts (3 reads)
- amplify-graphql-transformer-core/src/utils/schema-utils.ts (getKeySchema)
- amplify-graphql-conversation-transformer conversation-resolver-generator.ts1 parent 25bbb1d commit 481b874
3 files changed
Lines changed: 34 additions & 9 deletions
File tree
- packages
- amplify-graphql-conversation-transformer/src/transformer-steps
- amplify-graphql-relational-transformer/src
- amplify-graphql-transformer-core/src/utils
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
335 | 339 | | |
336 | 340 | | |
337 | 341 | | |
| |||
Lines changed: 15 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
| |||
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
57 | | - | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
| |||
136 | 148 | | |
137 | 149 | | |
138 | 150 | | |
139 | | - | |
| 151 | + | |
140 | 152 | | |
141 | 153 | | |
142 | 154 | | |
| |||
202 | 214 | | |
203 | 215 | | |
204 | 216 | | |
205 | | - | |
| 217 | + | |
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
| |||
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
| |||
0 commit comments