Skip to main content

Generate GraphQL Schemas from your SQLAlchemy models

Project description

graphql-sqlalchemy

PyPI version Build Status codecov Code Style

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphql-sqlalchemy-0.4.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

graphql_sqlalchemy-0.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file graphql-sqlalchemy-0.4.0.tar.gz.

File metadata

  • Download URL: graphql-sqlalchemy-0.4.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.7 CPython/3.6.7 Linux/4.15.0-1028-gcp

File hashes

Hashes for graphql-sqlalchemy-0.4.0.tar.gz
Algorithm Hash digest
SHA256 bf606c060af83d1532951dc2f5df2f17c904c2b973268b924e654702d7a00fd7
MD5 b3c419930dcda70d34511f2357d1b382
BLAKE2b-256 d0e18b3a08194dd4469adbaeab4fff13cbf234ca75a4eab4b459a5d6e41267cd

See more details on using hashes here.

File details

Details for the file graphql_sqlalchemy-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for graphql_sqlalchemy-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0529aecb90dba79d01fe0c6469939492029b353a20ab7bd41e4605583de517c
MD5 08b051b2b613eb167d22197fa8082882
BLAKE2b-256 0eeddb5c378bec57ae6da012bb076269c9a15c0d1e9a5338675b92251942cbb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page