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.6.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8727e8bb6cc568a3d085b2f186c14bb16fdf9d96b3463e82bb4ef9a697198b72 |
|
MD5 | 3fd654c89740bb1d1d133b5a3444a7c2 |
|
BLAKE2b-256 | b5961587dd65b522beb10636bfa60bba48387f2f290a92c28e9f997e36987fa9 |
Close
Hashes for graphene_sqlalchemy_auto-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b07a7a9fd4f7924dd1aee62f4bb9db73226534b0db5732069a2d4a5167a7a85e |
|
MD5 | b8e18f5011b42a6a48104b8004cb2ddc |
|
BLAKE2b-256 | 76863bba544e0ed53e0ee866ef33997f6d808c68b4e6850703427749e652ff88 |