generate default graphene schema from sqlalchemy model base on [graphene-sqlalchemy](https://github.com/graphql-python/graphene-sqlalchemy.git)
Project description
generate default graphene schema from sqlalchemy model base on graphene-sqlalchemy
Installation
just run
pip install graphene_sqlalchemy_auto
Features
- auto add
offset
limit
totalCount
to pagination - auto add
dbId
for model's database id - mutation auto return ok for success,message for more information and output for model data
How To Use
example :
from graphene_sqlalchemy_auto import QueryObjectType,MutationObjectType
from sqlalchemy.ext.declarative import declarative_base
import graphene
from sqlalchemy.orm import sessionmaker
Base = declarative_base()
Session = sessionmaker()
class Query(QueryObjectType):
class Meta:
declarative_base = Base
exclude_models = ["User"] # exclude models
class Mutation(MutationObjectType):
class Meta:
declarative_base = Base
session=Session() # mutate used
include_object = []# you can use yourself mutation UserCreateMutation, UserUpdateMutation
schema = graphene.Schema(query=Query, mutation=Mutation)
about many-to-many mutation
now you can use schema everywhere.some like flask,fastapi
also more example you can find in example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for graphene-sqlalchemy-auto-0.4.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22c01ef7055350321bcd2b30901e910877a539ee43304d26a3b84ab055122720 |
|
MD5 | 57da7ca0ac9ac9949c1827753a564f7e |
|
BLAKE2b-256 | 69a78ed42f1a4e09d3824ad8c3807ecf00f7ba66699dcbe2577a3810bc42b30f |
Close
Hashes for graphene_sqlalchemy_auto-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16c565e312b1c29742aef7177c64f20ae1e0e72dd758d4c74e738bdfae182f1a |
|
MD5 | 3a7f26ea8bad4bfee1d4824b37c5e220 |
|
BLAKE2b-256 | 957dd4df5987d96d13511263c09c1f088c5a635ed218bacc7fa30c19dd42d6af |