Generate GraphQL Schemas from your SQLAlchemy models
Project description
graphql-sqlalchemy
Generate GraphQL Schemas from your SQLAlchemy models
Install
pip install graphql-sqlalchemy
Usage
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()
session = Session()
schema = build_schema(Base)
app.mount("/graphql", GraphQL(schema, context_value=dict(session=session)))
Query
query MyQuery {
user(
where: {
_or: [
{ id: { _gte: 5 } },
{ name: { _like: "%bob%" } },
]
}
) {
id
name
}
model_by_pk(id: 5) {
createtime
}
}
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.5.2.tar.gz
.
File metadata
- Download URL: graphql-sqlalchemy-0.5.2.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.6.7 Linux/4.15.0-1028-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2341228da3a23e320e41fb899492b94d27b7ff9a760bbc17429b9d3a7acc9799 |
|
MD5 | fdb1c07a15d282005ebab72bb1789c9d |
|
BLAKE2b-256 | 48f91b3a1554c8725f6fbcfa6ac1e7adaa3c1885a180253b2b63f78b327aa768 |
File details
Details for the file graphql_sqlalchemy-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: graphql_sqlalchemy-0.5.2-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.9 CPython/3.6.7 Linux/4.15.0-1028-gcp
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 237041d81178e7bbc5be5cef778474ce3b35639e29a1d3993bfb45a1f89cbaaf |
|
MD5 | b2fe1e33b103a5e7aa554bf80ca20124 |
|
BLAKE2b-256 | 2f6c788df77d52961c60338972a153b36897684f5e2c1ba2c09fbf82dbfd1711 |