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.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3bb13fb84d81e600f64c8b0a092f61091265cfc92adaaad7dcb2d57b6bd9954 |
|
MD5 | e42811fc87d32f51123b06b3e220ae4a |
|
BLAKE2b-256 | 92506c9bbaa9d12f808e5f3117fb8074db0762fd60699e4e1d35da5dcc2eacc7 |
Close
Hashes for graphene_sqlalchemy_auto-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2661b9a71ec3c6145d3d1b7bbecee306511216164b428aeb8a6129c6ec7627b7 |
|
MD5 | ec2ac3f1135b962b737086be8efe2f92 |
|
BLAKE2b-256 | 534ee610350245f3ef384a1b351f576acf55bd77674f2e6f0775b22f8ea05314 |