# graphql-codegen-python

> Generate Python types from GraphQL files

Latest version **0.1.0** (published 2022-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-codegen-python
pnpm add graphql-codegen-python
yarn add graphql-codegen-python
bun add graphql-codegen-python
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-03-31 |
| First published | 2022-03-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | JRasmusBm |
| Maintainers | jrasmusbm |

## Links

- npm: https://www.npmjs.com/package/graphql-codegen-python
- Repository: https://github.com/JRasmusBm/graphql-codegen-ariadne
- Homepage: https://github.com/JRasmusBm/graphql-codegen-ariadne#readme
- Issues: https://github.com/JRasmusBm/graphql-codegen-ariadne/issues
- npm.io page: https://npm.io/package/graphql-codegen-python

## Dependencies (2)

- [@graphql-tools/schema](https://npm.io/package/@graphql-tools/schema.md) ^8.3.5
- [@graphql-codegen/plugin-helpers](https://npm.io/package/@graphql-codegen/plugin-helpers.md) ^2.4.2

## Recent versions

- 0.1.0 (latest) — 2022-03-31

## README

# graphql-codegen-python

> DISCLAIMER: This software is at the alpha stage. Feel free to experiment with
> it and to contribute, but do not expect it to work at this stage.

## Motivation

Working with GraphQL over multiple years has shown that it can be very
beneficial to make the schema files first class. One of the biggest advantages
to working with GraphQL is its strongly typed schema.

There are frameworks and tools in the Python ecosystem that are able to perform
type validation at run-time, but ideally we would want mismatches between
schema, operations and resolvers to be caught with static type checks.

Leveraging [GraphQL Code Generator](https://www.graphql-code-generator.com/),
this project aims to provide full Python type generation from GraphQL schema
files.

## Installation & Usage

1.  Clone the repository (or add it as a submodule)
2.  In the repository, run:
    1.  Run `npm i`
    2.  Run `npm run build`
3.  Add a graphql.codegen.yaml file to the root of the project, similar to the one below

```yaml
overwrite: true
schema: "<path-to-folder-with-graphql-schema-files>"
generates:
  <./relative/path/to/generated-types.py>:
    plugins:
      - "./dist/lib/index.js"
```

5. Run `npx @graphql-codegen/cli -c ./graphql-codegen.yaml`

---
_Source: https://npm.io/package/graphql-codegen-python · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
