dotansimha / dotansimha/graphql-code-generator-community
Add Python support (types, operations, and client generation)
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
**Is it related to a community plugin?**
Yes — this is a request for a new community plugin targeting Python.
**Is your feature request related to a problem? Please describe.**
***There is currently no official Python plugin family in `graphql-code-generator-community`.***
While TypeScript, Java, C#, and Dart are well-supported, Python developers working with GraphQL APIs currently are unable to use `graphql-codegen` for generation of types or untyped dictionaries. For polyglot ecosystems, the options currently are usage of tools specific to the Python ecosystem, or hand crafting types. This can lead to schema drift (when hand crafting types), or result in a complex developer environment setup.
Community interest around Python support has come up previously (such as in discussion [#2516](https://github.com/dotansimha/graphql-code-generator/discussions/2516) and draft PR [#4146](https://github.com/dotansimha/graphql-code-generator/pull/4146)). Having native Python code generation in the community repo would bridge this gap for Python services and client tooling.
**Describe the solution you'd like**
A Python plugin ecosystem within the community repo that generates idiomatic Python code from schemas and `.graphql` operations (schema types, operation/variable types, and client integrations).
We are currently working on an implementation and are interested in contributing it back to the community. We are opening this issue first to gauge maintainer appetite, confirm whether this target fits the repo's roadmap, and align on the preferred architecture before opening any pull requests.
**Describe alternatives you've considered**
- **Hand-writing types or using untyped dictionaries:** Prone to schema drift and eliminates the benefits of static type checking and editor completion.
- **Maintaining an internal/private generator:** Solves our team's immediate need, but misses out on shared community maintenance and doesn't benefit the broader GraphQL ecosystem.
- **Publishing a standalone npm plugin:** Feasible, but discoverability and long-term alignment with core patterns are significantly better inside the community repo.
- **Using Python-specific tooling:** Feasible, as there are already some excellent code generators for Python. However, for polyglot environments (where we are dealing with typescript, C# and Python) the developer experience is simplified by code generation being made available through a single tool.
**Additional context**
We are flexible on the exact scope, output styling (e.g., Pydantic vs. dataclasses), and rollout strategy. We look forward to hearing your thoughts on whether this fits the project's direction!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing discussion #2516 and draft PR #4146, then compare their proposed Python support with the community repository's existing plugin patterns. Done means agreeing on the plugin architecture, output scope, and rollout strategy before contributing the in-progress implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- backend-api-design, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100