Repository navigation
Give GraphQL models a __typename property graphql-core can read - #6792
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will degrade performance by 12.89%2 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: The PR adds a read-only, name-mangled typename property to the generated model of each GraphQL object type. This happens unless --graphql-no-typename is set, and it applies to pydantic v2 BaseModel, pydantic dataclass, dataclasses and msgspec Struct output. The property returns the existing typename field so graphql-core's default type resolver can resolve unions and interfaces. Input types, interface types, TypedDict output and custom model templates do not get the property, because of the new _HOLDS_PROPERTIES flag and the custom-template check. No fields, aliases, defaults, validation or serialization change, and no CLI option, public Python name or template variable is removed or renamed. The only removed lines are internal refactors in _rendered_names.py, base.py, output.py and an import in parser/graphql.py. Those refactors widen the internal name-binding and collision passes to cover method decorators, so a field named property makes the generator import builtins.property under an alias. The behaviour diff gate classifies every GraphQL cell, including the new typename_property input, as no-behaviour. Its only accepted cells are JSON Schema regex patterns that hold single quotes, which this diff does not touch, so they come from other changes since 0.95.0. The added property is therefore an additive code generation enhancement, not a breaking change to released behaviour. This analysis was produced by the release draft workflow |
|
🎉 Released in 0.96.0 This PR is now available in the latest release. See the release notes for details. |
Fixes: #6768
Summary by CodeRabbit
__typenameproperty across supported model types, making them easier to resolve in GraphQL unions and interfaces.