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.7.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9fe425c368fe0107472e7138b116c98db15bffb8858308534a6557b0e5da2a |
|
MD5 | 6929149647a3361a9d79d8b34a4ead3a |
|
BLAKE2b-256 | 74a2a1bc63ba26358933957578a005871d64bc39784199a5856a4c153f32fe02 |
Close
Hashes for graphene_sqlalchemy_auto-0.7.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ca82f382b60791e57f2d7725142c5c14f0e024fdf9332a36f72b70f7778256d |
|
MD5 | ce696f35e1a7e8149d3c67c1445ba740 |
|
BLAKE2b-256 | eb95305ee112fc6fd276d82c52be86eb4ee7738a31bc47f8fb400834fef92f69 |