{"id":13501785,"url":"https://github.com/graphql-python/gql","last_synced_at":"2025-05-14T22:05:35.163Z","repository":{"id":39817583,"uuid":"62077169","full_name":"graphql-python/gql","owner":"graphql-python","description":"A GraphQL client in Python","archived":false,"fork":false,"pushed_at":"2025-03-14T23:16:21.000Z","size":958,"stargazers_count":1601,"open_issues_count":11,"forks_count":184,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-14T22:04:16.268Z","etag":null,"topics":["async-transport","gql","graphql","graphql-client","websockets-transport"],"latest_commit_sha":null,"homepage":"https://gql.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphql-python.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-27T18:08:42.000Z","updated_at":"2025-04-28T05:38:13.000Z","dependencies_parsed_at":"2023-02-16T09:30:19.733Z","dependency_job_id":"bcd390b4-5ac0-43e0-a0f2-45497881374d","html_url":"https://github.com/graphql-python/gql","commit_stats":{"total_commits":303,"total_committers":56,"mean_commits":5.410714285714286,"dds":"0.44224422442244227","last_synced_commit":"1c657d87013f74ff36fdd5ae042e5b0b5f75065f"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-python%2Fgql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-python%2Fgql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-python%2Fgql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphql-python%2Fgql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphql-python","download_url":"https://codeload.github.com/graphql-python/gql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235687,"owners_count":22036962,"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":["async-transport","gql","graphql","graphql-client","websockets-transport"],"created_at":"2024-07-31T22:01:50.257Z","updated_at":"2025-05-14T22:05:35.119Z","avatar_url":"https://github.com/graphql-python.png","language":"Python","funding_links":[],"categories":["Python","graphql"],"sub_categories":[],"readme":"# GQL\n\nThis is a GraphQL client for Python 3.8+.\nPlays nicely with `graphene`, `graphql-core`, `graphql-js` and any other GraphQL implementation compatible with the spec.\n\nGQL architecture is inspired by `React-Relay` and `Apollo-Client`.\n\n[![GitHub-Actions][gh-image]][gh-url]\n[![pyversion][pyversion-image]][pyversion-url]\n[![pypi][pypi-image]][pypi-url]\n[![Anaconda-Server Badge][conda-image]][conda-url]\n[![codecov][codecov-image]][codecov-url]\n\n[gh-image]: https://github.com/graphql-python/gql/workflows/Tests/badge.svg\n[gh-url]: https://github.com/graphql-python/gql/actions?query=workflow%3ATests\n[pyversion-image]: https://img.shields.io/pypi/pyversions/gql\n[pyversion-url]: https://pypi.org/project/gql/\n[pypi-image]: https://img.shields.io/pypi/v/gql.svg?style=flat\n[pypi-url]: https://pypi.org/project/gql/\n[conda-image]: https://img.shields.io/conda/vn/conda-forge/gql.svg\n[conda-url]: https://anaconda.org/conda-forge/gql\n[codecov-image]: https://codecov.io/gh/graphql-python/gql/branch/master/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/graphql-python/gql\n\n## Documentation\n\nThe complete documentation for GQL can be found at\n[gql.readthedocs.io](https://gql.readthedocs.io).\n\n## Features\n\n* Execute GraphQL queries using [different protocols](https://gql.readthedocs.io/en/latest/transports/index.html):\n  * http\n  * websockets:\n    * apollo or graphql-ws protocol\n    * Phoenix channels\n    * AWS AppSync realtime protocol (experimental)\n* Possibility to [validate the queries locally](https://gql.readthedocs.io/en/latest/usage/validation.html) using a GraphQL schema provided locally or fetched from the backend using an instrospection query\n* Supports GraphQL queries, mutations and [subscriptions](https://gql.readthedocs.io/en/latest/usage/subscriptions.html)\n* Supports [sync or async usage](https://gql.readthedocs.io/en/latest/async/index.html), [allowing concurrent requests](https://gql.readthedocs.io/en/latest/advanced/async_advanced_usage.html#async-advanced-usage)\n* Supports [File uploads](https://gql.readthedocs.io/en/latest/usage/file_upload.html)\n* Supports [Custom scalars / Enums](https://gql.readthedocs.io/en/latest/usage/custom_scalars_and_enums.html)\n* [gql-cli script](https://gql.readthedocs.io/en/latest/gql-cli/intro.html) to execute GraphQL queries or download schemas from the command line\n* [DSL module](https://gql.readthedocs.io/en/latest/advanced/dsl_module.html) to compose GraphQL queries dynamically\n\n## Installation\n\nYou can install GQL with all the optional dependencies using pip:\n\n```bash\n# Quotes may be required on certain shells such as zsh.\npip install \"gql[all]\"\n```\n\n\u003e **NOTE**: See also [the documentation](https://gql.readthedocs.io/en/latest/intro.html#less-dependencies) to install GQL with less extra dependencies depending on the transports you would like to use or for alternative installation methods.\n\n## Usage\n\n### Basic usage\n\n```python\nfrom gql import gql, Client\nfrom gql.transport.aiohttp import AIOHTTPTransport\n\n# Select your transport with a defined url endpoint\ntransport = AIOHTTPTransport(url=\"https://countries.trevorblades.com/\")\n\n# Create a GraphQL client using the defined transport\nclient = Client(transport=transport, fetch_schema_from_transport=True)\n\n# Provide a GraphQL query\nquery = gql(\n    \"\"\"\n    query getContinents {\n      continents {\n        code\n        name\n      }\n    }\n\"\"\"\n)\n\n# Execute the query on the transport\nresult = client.execute(query)\nprint(result)\n```\n\nExecuting the above code should output the following result:\n\n```\n$ python basic_example.py\n{'continents': [{'code': 'AF', 'name': 'Africa'}, {'code': 'AN', 'name': 'Antarctica'}, {'code': 'AS', 'name': 'Asia'}, {'code': 'EU', 'name': 'Europe'}, {'code': 'NA', 'name': 'North America'}, {'code': 'OC', 'name': 'Oceania'}, {'code': 'SA', 'name': 'South America'}]}\n```\n\n\u003e **WARNING**: Please note that this basic example won't work if you have an asyncio event loop running. In some\n\u003e python environments (as with Jupyter which uses IPython) an asyncio event loop is created for you. In that case you\n\u003e should use instead the [async usage example](https://gql.readthedocs.io/en/latest/async/async_usage.html#async-usage).\n\n## Contributing\nSee [CONTRIBUTING.md](CONTRIBUTING.md)\n\n## License\n\n[MIT License](https://github.com/graphql-python/gql/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-python%2Fgql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphql-python%2Fgql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphql-python%2Fgql/lists"}