Generate GraphQL Schemas from your SQLAlchemy models
Project description
Generate GraphQL Schemas from your SQLAlchemy models
Install
pip install graphql-sqlalchemy
Usage
from ariadne import QueryType
from ariadne.asgi import GraphQL
from fastapi import FastAPI
from graphql_sqlalchemy import build_schema
from .session import Session
from .base import Base
app = FastAPI()
query = QueryType()
session = Session()
schema = build_schema(Base)
query.bind_to_schema(schema)
app.mount("/graphql", GraphQL(schema, context_value=dict(session=session)))
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
File details
Details for the file graphql-sqlalchemy-0.1.0.tar.gz
.
File metadata
- Download URL: graphql-sqlalchemy-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b10e3aad1cff44201c4101e9ef20f541c8d0d6f5de78b254a805a7aa14b43d2d |
|
MD5 | 9a1b9337d86380675faa8b86d0cbfe52 |
|
BLAKE2b-256 | 69430f81c58cbd0aa40b82ed0f5abed126566293dcf1e8c7b47eb4e24cdd24c4 |
File details
Details for the file graphql_sqlalchemy-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: graphql_sqlalchemy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.7.7 Darwin/19.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a8999adc0efc73fa1d568c20ec133a26a473f86abc36363bf40c5037ce684d |
|
MD5 | 1f2321109a338bb1253341d3226d2f8a |
|
BLAKE2b-256 | ceb29117c10faffaca1c7404b105902a0b01359f00ecbb0c16e30780800bbc8f |