{"id":14976144,"url":"https://github.com/flying-sheep/graphql-sqlalchemy","last_synced_at":"2025-10-27T18:30:37.771Z","repository":{"id":197446142,"uuid":"698670540","full_name":"flying-sheep/graphql-sqlalchemy","owner":"flying-sheep","description":"Generate GraphQL Schemas from your SQLAlchemy models","archived":false,"fork":false,"pushed_at":"2025-02-03T18:09:15.000Z","size":172,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-03T19:24:37.992Z","etag":null,"topics":["graphql","graphql-query","sqlalchemy","sqlalchemy-orm"],"latest_commit_sha":null,"homepage":"https://graphql-sqlalchemy.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"gzzo/graphql-sqlalchemy","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flying-sheep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-30T15:56:56.000Z","updated_at":"2023-10-18T11:44:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"b502e5c3-d6ad-4419-8cea-8f9d177db417","html_url":"https://github.com/flying-sheep/graphql-sqlalchemy","commit_stats":{"total_commits":79,"total_committers":4,"mean_commits":19.75,"dds":"0.21518987341772156","last_synced_commit":"e151700a62ae10aa048dd19713a8937d549dddf1"},"previous_names":["flying-sheep/graphql-sqlalchemy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flying-sheep%2Fgraphql-sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flying-sheep%2Fgraphql-sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flying-sheep%2Fgraphql-sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flying-sheep%2Fgraphql-sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flying-sheep","download_url":"https://codeload.github.com/flying-sheep/graphql-sqlalchemy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238536089,"owners_count":19488654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","graphql-query","sqlalchemy","sqlalchemy-orm"],"created_at":"2024-09-24T13:53:23.149Z","updated_at":"2025-10-27T18:30:32.477Z","avatar_url":"https://github.com/flying-sheep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphql-sqlalchemy\n\n[![PyPI version](https://badge.fury.io/py/graphql-sqlalchemy.svg)](https://badge.fury.io/py/graphql-sqlalchemy)\n[![Unit Tests](https://github.com/flying-sheep/graphql-sqlalchemy/actions/workflows/run_tests.yml/badge.svg)](https://github.com/flying-sheep/graphql-sqlalchemy/actions/workflows/run_tests.yml)\n[![codecov](https://codecov.io/gh/flying-sheep/graphql-sqlalchemy/graph/badge.svg)](https://codecov.io/gh/flying-sheep/graphql-sqlalchemy)\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nGenerate GraphQL Schemas from your SQLAlchemy models\n\n# Install\n\n```\npip install graphql-sqlalchemy\n```\n\n# Usage\n\n```python\nfrom ariadne.asgi import GraphQL\nfrom fastapi import FastAPI\nfrom sqlalchemy import create_engine\nfrom sqlalchemy.orm import sessionmaker, declarative_base\nfrom graphql_sqlalchemy import build_schema\n\nengine = create_engine('sqlite:///config.db')\nBase = declarative_base()\nSession = sessionmaker(bind=engine)\n\napp = FastAPI()\nsession = Session()\n\nschema = build_schema(Base)\n\napp.mount(\"/graphql\", GraphQL(schema, context_value=dict(session=session)))\n```\n\n# Query\n\n```graphql\nquery {\n    user(where: { _or: [{ id: { _gte: 5 } }, { name: { _like: \"%bob%\" } }] }) {\n        id\n        name\n    }\n    user_by_pk(id: 5) {\n        createtime\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflying-sheep%2Fgraphql-sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflying-sheep%2Fgraphql-sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflying-sheep%2Fgraphql-sqlalchemy/lists"}