- Notifications
You must be signed in to change notification settings - Fork9
Generate pydantic types from any graphql schema
License
qw-in/graphql-codegen-pydantic
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Warning
Unfortunatly, I never did find the time to flesh out this plugin & I've moved on from both GraphQL & Python for the time being.
If you are looking for alternatives, consider@jhnnsrs's turms (see#10).
Please feel free to contact me if you are interested in taking over this package. Thanks!
--Quinn (@qw-in)
graphql-codegen-pydantic is a plugin forgraphql-codegenthat generatespydantic types from any graphql schema
typeBook {title:Stringauthor:Author}typeAuthor {name:Stringbooks: [Book]}
becomes
fromtypingimportOptional,ListfrompydanticimportBaseModelclassAuthor(BaseModel):name:Optional[str]books:Optional[List[Optional['Book']]]classBook(BaseModel):title:Optional[str]author:Optional['Author']
graphql-codegen-pydantic is currently still very experimental and isnot ready for production use
- Set up
graphql-codegen - Install
graphql-codegen-pydantic
yarn add graphql-codegen-pydantic -D
- Add python file to
codegen.yml
schema:http://localhost:3000/graphqlgenerates:./src/schema.py:plugins: -pydantic
Currently very limited
- No configuration supported
- No comments included in generated code
- No support for documents
- No resolver support for eg graphene or ariadne
- Properties converted to
snake_case
About
Generate pydantic types from any graphql schema
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.