-
-
Notifications
You must be signed in to change notification settings - Fork 609
feat: use TypedDict for Python query codegen #4089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: use TypedDict for Python query codegen #4089
Conversation
Reviewer's GuideUpdates the Python query code generation to emit TypedDict-based result and input types (using NotRequired for optional fields with defaults), teaches schema codegen to gracefully skip custom directive definitions and improves its error messaging, and refreshes tests/docs plus adds a release note for these behaviors. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4089 +/- ##
==========================================
- Coverage 94.22% 94.21% -0.02%
==========================================
Files 541 541
Lines 35519 35521 +2
Branches 1877 1877
==========================================
- Hits 33469 33466 -3
- Misses 1739 1747 +8
+ Partials 311 308 -3 🚀 New features to boost your workflow:
|
Change the Python query codegen plugin to generate TypedDict classes instead of plain classes. This provides better type safety for dictionary-like access patterns commonly used when working with JSON responses from GraphQL APIs. Optional fields with default values now use NotRequired instead of the = value syntax (which TypedDict doesn't support). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
11caefc to
21c18bf
Compare
Use TypedDict for Python query codegen.
Description
🤖 Generated with Claude Code
Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Switch Python query code generation to use TypedDict-based result and input types and improve schema codegen handling of custom directives and errors.
New Features:
Enhancements:
Documentation:
Tests: