Commit 58e631e
unknown
fix(codegen): add select param and JSON input parsing to custom command generator
Custom mutation/query commands generated by the CLI codegen were missing
the required 'select' parameter when calling ORM operations, causing
'Cannot read properties of undefined (reading select)' at runtime.
Changes:
- buildOrmCustomCall now passes { select: {...} } as second argument
- Extracts return type fields from CleanOperation to build select object
- Falls back to { clientMutationId: true } for mutations without known fields
- Detects INPUT_OBJECT args and adds parseMutationInput() for JSON parsing
- Imports parseMutationInput from utils when needed1 parent f6fa997 commit 58e631e
2 files changed
Lines changed: 97 additions & 7 deletions
File tree
- graphql/codegen/src
- __tests__/codegen/__snapshots__
- core/codegen/cli
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1151 | 1151 | | |
1152 | 1152 | | |
1153 | 1153 | | |
1154 | | - | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
1155 | 1157 | | |
1156 | 1158 | | |
1157 | 1159 | | |
| |||
1395 | 1397 | | |
1396 | 1398 | | |
1397 | 1399 | | |
1398 | | - | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1399 | 1405 | | |
1400 | 1406 | | |
1401 | 1407 | | |
| |||
3555 | 3561 | | |
3556 | 3562 | | |
3557 | 3563 | | |
3558 | | - | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
3559 | 3569 | | |
3560 | 3570 | | |
3561 | 3571 | | |
| |||
Lines changed: 84 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
103 | 142 | | |
104 | 143 | | |
105 | 144 | | |
106 | 145 | | |
| 146 | + | |
107 | 147 | | |
108 | 148 | | |
109 | 149 | | |
| |||
115 | 155 | | |
116 | 156 | | |
117 | 157 | | |
118 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
119 | 164 | | |
120 | 165 | | |
121 | 166 | | |
| |||
139 | 184 | | |
140 | 185 | | |
141 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
142 | 197 | | |
143 | 198 | | |
144 | 199 | | |
145 | 200 | | |
146 | 201 | | |
147 | 202 | | |
148 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
149 | 210 | | |
150 | 211 | | |
151 | 212 | | |
| |||
224 | 285 | | |
225 | 286 | | |
226 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
227 | 303 | | |
228 | 304 | | |
229 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
230 | 308 | | |
231 | 309 | | |
| 310 | + | |
| 311 | + | |
232 | 312 | | |
233 | 313 | | |
234 | 314 | | |
235 | 315 | | |
236 | 316 | | |
237 | | - | |
| 317 | + | |
238 | 318 | | |
239 | 319 | | |
240 | 320 | | |
| |||
0 commit comments