{"id":51515734,"url":"https://github.com/meta-engine/graphql-httpx","last_synced_at":"2026-07-08T11:00:58.225Z","repository":{"id":365675464,"uuid":"1271506915","full_name":"meta-engine/graphql-httpx","owner":"meta-engine","description":"Generate idiomatic Python (Pydantic v2 + httpx) clients and models from GraphQL schemas. Self-contained — no .NET install required.","archived":false,"fork":false,"pushed_at":"2026-06-16T18:23:59.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-18T12:15:55.570Z","etag":null,"topics":["api-client","codegen","graphql-codegen","httpx","metaengine","pydantic","python"],"latest_commit_sha":null,"homepage":"https://www.metaengine.eu/packages/graphql-httpx","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meta-engine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-16T18:23:55.000Z","updated_at":"2026-06-16T18:24:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meta-engine/graphql-httpx","commit_stats":null,"previous_names":["meta-engine/graphql-httpx"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/meta-engine/graphql-httpx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fgraphql-httpx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fgraphql-httpx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fgraphql-httpx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fgraphql-httpx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meta-engine","download_url":"https://codeload.github.com/meta-engine/graphql-httpx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fgraphql-httpx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35262336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","codegen","graphql-codegen","httpx","metaengine","pydantic","python"],"created_at":"2026-07-08T11:00:57.443Z","updated_at":"2026-07-08T11:00:58.218Z","avatar_url":"https://github.com/meta-engine.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetaEngine GraphQL Python httpx\n\n[![PyPI version](https://img.shields.io/pypi/v/metaengine-graphql-httpx.svg)](https://pypi.org/project/metaengine-graphql-httpx/)\n[![Python versions](https://img.shields.io/pypi/pyversions/metaengine-graphql-httpx.svg)](https://pypi.org/project/metaengine-graphql-httpx/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Generate idiomatic Python clients and models from a GraphQL schema (SDL).**\n\nPydantic v2 models and an async `httpx` client — typed, with bearer/basic auth, retries, timeouts, error handling, custom headers, fragments, `@oneOf` inputs, and optional docstrings.\n\n\u003e **No .NET required.** Unlike most MetaEngine wrappers, each wheel bundles a **self-contained, platform-native binary** — `pip install` and run. There is nothing else to install.\n\n---\n\n## Quick Links\n\n- **PyPI Package**: [metaengine-graphql-httpx](https://pypi.org/project/metaengine-graphql-httpx/)\n- **NuGet Package**: [MetaEngine.Python.GraphQL.Httpx](https://www.nuget.org/packages/MetaEngine.Python.GraphQL.Httpx)\n- **Website**: [metaengine.eu](https://www.metaengine.eu)\n\n---\n\n## Features\n\n- ✅ **Self-contained** - Bundled native binary per platform; no .NET runtime to install\n- ✅ **Pydantic v2 models** - `BaseModel` with `ConfigDict`, typed fields, required vs optional\n- ✅ **Async httpx client** - typed service methods, `model_validate` on responses\n- ✅ **Fragments** - Reusable named fragments for object-type selections\n- ✅ **`@oneOf` inputs** - Idiomatic tagged-union input types\n- ✅ **Custom scalars** - Map GraphQL custom scalars to Python types (`str`, `int`, `float`, `bool`, `datetime`, `Any`)\n- ✅ **Auth \u0026 resilience** - Bearer/basic auth, retries with backoff, timeouts, smart error handling, custom headers\n- ✅ **camelCase aliases** - snake_case Python properties mapped to camelCase wire names via `Field(alias=...)`\n- ✅ **Docstrings** - Optional doc-comment generation from SDL descriptions\n\n---\n\n## Installation\n\n```bash\npip install metaengine-graphql-httpx\n```\n\nPre-built wheels are published for Linux (x86_64, aarch64), macOS (Apple Silicon + Intel), and Windows (x64).\n\n---\n\n## Requirements\n\n- **Python 3.8** or later\n- **No .NET runtime** - the wheel ships a self-contained native binary for your platform\n\n---\n\n## Quick Start\n\n```bash\nmetaengine-graphql-httpx \u003cinput\u003e \u003coutput\u003e [options]\n```\n\n### Recommended Setup\n\n```bash\nmetaengine-graphql-httpx schema.graphql ./generated \\\n  --fragments \\\n  --documentation\n```\n\n### More Examples\n\n```bash\n# Bearer auth + retries\nmetaengine-graphql-httpx schema.graphql ./generated --bearer-auth API_TOKEN --retries 3\n\n# Map a custom scalar + emit @oneOf input types\nmetaengine-graphql-httpx schema.graphql ./generated --custom-scalar DateTime=datetime --one-of-inputs\n\n# Timeout, error handling, and a static header from an env var\nmetaengine-graphql-httpx schema.graphql ./generated --timeout 30 --error-handling --custom-header X-Tenant-ID=TENANT_ID\n```\n\n---\n\n## CLI Options\n\n| Argument / Option | Description | Default |\n|---|---|---|\n| `input` *(required)* | GraphQL schema file path (SDL) or inline SDL content | - |\n| `output` *(required)* | Output directory for generated Python files | - |\n| `--fragments` | Emit reusable named fragments for object-type selections | `false` |\n| `--one-of-inputs` | Generate idiomatic `@oneOf` input types (tagged-union inputs) | `false` |\n| `--custom-scalar \u003cScalar\u003e=\u003ctarget\u003e` | Map a GraphQL custom scalar to a Python type (repeatable). Targets: `str`, `int`, `float`, `bool`, `datetime`, `Any` | - |\n| `--bearer-auth \u003cENV\u003e` | Bearer token from env var (e.g. `API_TOKEN`) | - |\n| `--basic-auth \u003cUSER_ENV\u003e=\u003cPASS_ENV\u003e` | Basic auth from env vars | - |\n| `--retries \u003cn\u003e` | Enable retries with exponential backoff; value sets max attempts | - |\n| `--timeout \u003cs\u003e` | Request timeout in seconds for all operations | - |\n| `--error-handling` | Smart error handling based on HTTP status semantics | `false` |\n| `--custom-header \u003cHeader\u003e=\u003cENV\u003e` | Static header from env var (repeatable) | - |\n| `--base-url-env \u003cENV\u003e` | Environment variable name for base URL | `API_BASE_URL` |\n| `--sync-methods` | Generate synchronous service methods alongside the async client | `false` |\n| `--middleware` | Generate httpx transport middleware infrastructure | `false` |\n| `--documentation` | Generate docstring comments from SDL descriptions | `false` |\n| `--camel-case-aliases` | Generate camelCase field aliases for Pydantic models | `false` |\n| `--options-threshold \u003cn\u003e` | Parameter count at which a method switches to an options object | `4` |\n| `--service-suffix \u003cname\u003e` | Service class naming suffix | `Service` |\n| `--verbose` | Enable verbose logging | `false` |\n\n---\n\n## Generated Code Structure\n\n```\noutput/\n  ├── models/                    # One file per GraphQL type (Pydantic v2)\n  │   ├── post.py                # class Post(BaseModel): ...\n  │   ├── user.py                # class User(BaseModel): ...\n  │   └── ...\n  ├── services/                  # Async httpx client + base transport\n  │   ├── query_service.py       # class QueryService with the root operations\n  │   ├── base_http_service.py   # shared transport (auth, retries, error handling)\n  │   └── ...\n  └── fragments.py               # reusable named fragments (with --fragments)\n```\n\nModels use Pydantic v2 (`BaseModel` + `ConfigDict`); with `--camel-case-aliases`, snake_case\nproperties carry a `Field(alias=...)` mapping to the wire name and `populate_by_name=True`:\n\n```python\nclass User(BaseModel):\n    model_config = ConfigDict(populate_by_name=True)\n    id: str\n    display_name: str = Field(alias='displayName')\n```\n\n---\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/meta-engine/graphql-httpx/issues)\n- **Email**: info@metaengine.eu\n- **Website**: [metaengine.eu](https://www.metaengine.eu)\n\n---\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n\n---\n\n## About This Repository\n\nThis is the **documentation and issue tracking repository** for MetaEngine GraphQL Python httpx. The package is published to [PyPI](https://pypi.org/project/metaengine-graphql-httpx/).\n\nSource code is proprietary, but the package is free to use under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-engine%2Fgraphql-httpx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeta-engine%2Fgraphql-httpx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-engine%2Fgraphql-httpx/lists"}