generate default graphene schema from sqlalchemy model base on graphene-sqlalchemy
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.10.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70091f24f6a5897820d96580f6e14afe38e2a76d0968fb863ef659d78e80fbc7 |
|
MD5 | aebb778c0d26523289a1af1fe79d015d |
|
BLAKE2b-256 | 0fcc21b6f9c903b39cbe52a36c63be51d153bca0b3c226a1a7919416e58fdb59 |
Close
Hashes for graphene_sqlalchemy_auto-0.10.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a5925d3abafb37c6581658f801fb26f84551593da9d547b1689fcde4cf46f0b |
|
MD5 | fb6d716d0fc0d6773a99eacf42a0a512 |
|
BLAKE2b-256 | 8ba79b33ef9f519f7d74667ea7beb7a728477802262b525c80b28e140fca341b |