Commit 40fccaa
committed
Address PR #1373 review: fix to_global_id metaclass bug
`graphene_model` in `DRFMutation.IOSettings` is the `DjangoObjectType`
class, so `.__class__.__name__` returned graphene's metaclass name
(`SubclassWithMeta_Meta`) instead of the GraphQL type name. The
resulting `to_global_id(...)` payloads in both create and update return
paths used the wrong type name; switched to `graphene_model.__name__`
to match the convention used everywhere else in `config/graphql/`
(e.g. `to_global_id("CorpusType", ...)`).
The bug went unnoticed because the frontend rarely consumes the
returned `obj_id` directly — it re-resolves the new object from its
Apollo cache by global id. The newly-explicit
`ClassVar[Optional[type[...]]]` annotations made the inconsistency
visible.
Also clarified the CHANGELOG: `DRFDeletion.mutate` has no `try/except`,
so its `NotImplementedError` / `ValueError` guards propagate to graphene
as GraphQL execution errors rather than the `ok=False` "internal error"
path used by `DRFMutation`.1 parent 802b431 commit 40fccaa
2 files changed
Lines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
264 | 269 | | |
265 | 270 | | |
266 | 271 | | |
| |||
280 | 285 | | |
281 | 286 | | |
282 | 287 | | |
283 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
284 | 294 | | |
285 | 295 | | |
286 | 296 | | |
| |||
0 commit comments