Commit a13d74d
Add
* Initial plan
* Add include_typename configuration option to ClientSettings and ResultTypesGenerator
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Add comprehensive tests for include_typename functionality
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Fix discriminator field generation when include_typename=False
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Implement Optional typename approach for better API compatibility
- Fix parsing error in test: change 'animals' to 'animal' to match schema
- Always generate discriminator for union types (even when include_typename=False)
- Make typename__ field Optional[Literal[...]] = None when include_typename=False
- This allows models to work with APIs that don't return __typename while maintaining union discrimination capability
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Fix include_typename functionality - remove discriminator when __typename unavailable
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Fix discriminator generation to respect include_typename setting
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* Initial plan
* Fix linting errors: line length and import sorting
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>
* chore: fix checks
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jacksonpradolima <7774063+jacksonpradolima@users.noreply.github.com>include_typename configuration option for better GraphQL API compatibility (#379)1 parent b48fa12 commit a13d74d
File tree
8 files changed
+440
-16
lines changed- ariadne_codegen
- client_generators
- tests
- client_generators/result_types_generator
8 files changed
+440
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| 137 | + | |
136 | 138 | | |
137 | 139 | | |
138 | 140 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| 204 | + | |
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| |||
454 | 457 | | |
455 | 458 | | |
456 | 459 | | |
| 460 | + | |
457 | 461 | | |
458 | 462 | | |
459 | 463 | | |
| |||
533 | 537 | | |
534 | 538 | | |
535 | 539 | | |
| 540 | + | |
536 | 541 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
110 | | - | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | 372 | | |
370 | | - | |
| 373 | + | |
371 | 374 | | |
372 | 375 | | |
373 | 376 | | |
| |||
376 | 379 | | |
377 | 380 | | |
378 | 381 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
390 | 397 | | |
391 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
392 | 401 | | |
393 | 402 | | |
394 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
| 103 | + | |
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| |||
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| 267 | + | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
| |||
382 | 385 | | |
383 | 386 | | |
384 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
385 | 392 | | |
386 | 393 | | |
387 | 394 | | |
| |||
436 | 443 | | |
437 | 444 | | |
438 | 445 | | |
439 | | - | |
| 446 | + | |
440 | 447 | | |
441 | 448 | | |
442 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
167 | 168 | | |
168 | 169 | | |
169 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
| |||
183 | 189 | | |
184 | 190 | | |
185 | 191 | | |
| 192 | + | |
186 | 193 | | |
187 | 194 | | |
188 | 195 | | |
| |||
0 commit comments