Skip to main content

graphql-sqlalchemy

PyPI version Build Status codecov Code Style

Generate GraphQL Schemas from your SQLAlchemy models

Install

pip install graphql-sqlalchemy

Usage

    from ariadne.asgi import GraphQL
    from fastapi import FastAPI
    from sqlalchemy import create_engine
    from sqlalchemy.ext.declarative import declarative_base
    from sqlalchemy.orm import sessionmaker
    from graphql_sqlalchemy import build_schema

    engine = create_engine('sqlite:///config.db')
    Base = declarative_base()
    Session = sessionmaker(bind=engine)

    app = FastAPI()
    session = Session()

    schema = build_schema(Base)

    app.mount("/graphql", GraphQL(schema, context_value=dict(session=session)))

Query

query {
    user(
        where: {
            _or: [
                { id: { _gte: 5 } },
                { name: { _like: "%bob%" } },
            ]
        }
    ) {
        id
        name
    }
    user_by_pk(id: 5) {
        createtime
    }
}

Metadata

Release files for graphql-sqlalchemy 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphql-sqlalchemy 0.6.1
File Size Uploaded Provenance Actions
graphql-sqlalchemy-0.6.1.tar.gz 9.0 kB Without provenance Details for graphql-sqlalchemy-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for graphql-sqlalchemy 0.6.1
File Interpreter ABI Platform Actions
graphql_sqlalchemy-0.6.1-py3-none-any.whl Python 3 none any Details for graphql_sqlalchemy-0.6.1-py3-none-any.whl

Total release size: 20.3 kB

Release files / graphql-sqlalchemy-0.6.1.tar.gz

Download URL graphql-sqlalchemy-0.6.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
364a873a94285d136aaf0c4e8b48cc3de9f50cb45cbfa107df6e01ab28a26abc
BLAKE2b-256 checksum
How to use checksums
1f2ecde85d2a9fffdf4b2a88527a3887a0ab90f00ef72442871d1db186eb31f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.7 Darwin/20.3.0

Release files / graphql_sqlalchemy-0.6.1-py3-none-any.whl

Download URL graphql_sqlalchemy-0.6.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ec77fa884ddc186d99eb6a8fe849acce4a3c8b4d99780553073fcf6360a3cf47
BLAKE2b-256 checksum
How to use checksums
0fe74c4a75c26c7e7ea84c0151438deee25a306b744edf9371e550702e4eefeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.5 CPython/3.7.7 Darwin/20.3.0

Security for graphql-sqlalchemy 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page