Skip to content

Commit a14573b

Browse files
committed
Address review feedback: collapse multi-line comment block
Per CLAUDE.md (no multi-paragraph comments), reduce both to_global_id call-site comments to a single line that still captures the .__name__ vs .__class__.__name__ distinction.
1 parent 4a1a32c commit a14573b

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

config/graphql/base.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,7 @@ def mutate(cls, root, info, *args, **kwargs):
260260
obj_serializer.save()
261261
ok = True
262262
message = "Success"
263-
# `graphene_model` is the DjangoObjectType class itself, so
264-
# `.__name__` yields the GraphQL type name (e.g. "CorpusType").
265-
# The previous `.__class__.__name__` returned the metaclass
266-
# name (graphene's `SubclassWithMeta_Meta`) which produced an
267-
# incorrect global id.
263+
# graphene_model is the class; .__name__ is the GraphQL type (.__class__.__name__ is the metaclass).
268264
obj_id = to_global_id(graphene_model.__name__, obj.id)
269265
logger.info("Succeeded updating obj")
270266

@@ -285,11 +281,7 @@ def mutate(cls, root, info, *args, **kwargs):
285281

286282
ok = True
287283
message = "Success"
288-
# `graphene_model` is the DjangoObjectType class itself, so
289-
# `.__name__` yields the GraphQL type name (e.g. "CorpusType").
290-
# The previous `.__class__.__name__` returned the metaclass
291-
# name (graphene's `SubclassWithMeta_Meta`) which produced an
292-
# incorrect global id.
284+
# graphene_model is the class; .__name__ is the GraphQL type (.__class__.__name__ is the metaclass).
293285
obj_id = to_global_id(graphene_model.__name__, obj.id)
294286

295287
except serializers.ValidationError as ve:

0 commit comments

Comments
 (0)