graphql2python is a tool that generates python code out of your GraphQL schema. If you are using python as GraphQL client you can to generate GraphQL queries and pydantic data-model with graphql2python.
The documentation for graphql2python can be found at https://denisart.github.io/graphql2python.
graphql2python has the following tools for your python GraphQL client:
- python classes for generate of GraphQL queries;
- the function for generation of pydantic data-model by your GraphQL schema;
- ... (in future releases);
The special example for gql users here.
Install with pip
pip install graphql2pythonCreate the following file
# graphql2python.yaml schema: ./schema.graphql output: ./model.pyand run the following command
graphql2python render --config ./graphql2python.yaml