{ "info": { "author": "Eran Kampf", "author_email": "eran@ekampf.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# GQL: Python GraphQL Client Library\n\n[![Build Status](https://travis-ci.org/ekampf/cql.svg?branch=master)](https://travis-ci.org/ekampf/cql)\n[![Coverage Status](https://coveralls.io/repos/github/ekampf/gql/badge.svg?branch=master)](https://coveralls.io/github/ekampf/gql?branch=master)\n\n## Introduction\n\nGQL is a GraphQL Client Python library intended to help Python application make GraphQL\nAPI call while enjoying the advantages that come with GraphQL.\n\n- **Strongly Typed** response objects (dynamically created in build time to match your query)\n- **Query Validation** that checks your code's queries against the GraphQL server's schema.\n\n## Installation\n\nSimply install from PyPi:\n\n```bash\npip install gql-next\n```\n\nThen go to your project folder and run `gql init`\n\n## Quick Start\n\n`gql` works by parsing query files (`**/*.graphql` by default) into their own Python module where\nan class, named after the operation defined in the file, allows you to make that query and get a typed\nresponse.\n\nFor example, given the following file `get_film.graphql` file:\n```\nquery GetFilm($id: ID!) {\n film(id: $id) {\n title\n director\n }\n}\n```\n\nA `get_film.py` will be created defining a `GetFilm` class:\n\n```python\n# AUTOGENERATED file. Do not Change!\nfrom typing import Any, Callable, Mapping, List\nfrom enum import Enum\nfrom dataclasses import dataclass\nfrom dataclasses_json import dataclass_json\nfrom gql.clients import Client, AsyncIOClient\n\n\n@dataclass_json\n@dataclass\nclass GetFilm:\n @dataclass_json\n @dataclass\n class GetFilmData:\n @dataclass_json\n @dataclass\n class Film:\n title: str\n director: str\n film: Film = None\n\n data: GetFilmData = None\n errors: Any = None\n\n @classmethod\n def execute(cls, id: str, on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None) -> GetFilm:\n ...\n\n @classmethod\n async def execute_async(cls, id: str, on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None) -> GetFilm:\n ...\n```\n\nAllowing you to make the GraphQL query:\n\n```python\nfrom .get_film import GetFilm\n\nresult = GetFilm.execute('meaning_of_life')\nfilm = result.data.film\n```\n\n*Important notes:*\n* Operations defined in graphql query __must be named__ so that we can name the relevant Python Class which you can then import in your code\n\n\n## How it works\n\n\n### The `gql` client\n\n#### `gql init`\nInitializes a project to use GQL as client - writes a .gql.json configuration file.\n\n#### `gql run`\n\nRun through your project's files and compile GraphQL queries into into Python types.\n\n#### `gql watch`\n\nUseful during development. Listen to file changes in your project's folder and continuously\nbuilds GraphQL queries as they change.\nThis allows you to:\n* Immediately verify query changes you make are valid.\n* Enjoy your IDE's autocomplete features on GraphQL auto-generated objects while developing\nas `watch` will auto-update them as you change queries.\n\n\n# Sponsors\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "Eran Kampf", "maintainer_email": "eran@ekampf.com", "name": "gql-next", "package_url": "https://pypi.org/project/gql-next/", "platform": "", "project_url": "https://pypi.org/project/gql-next/", "project_urls": null, "release_url": "https://pypi.org/project/gql-next/0.1.1/", "requires_dist": [ "click (>=7.0,<8.0)", "graphql-core-next (>=1.0.0,<1.1.0)", "requests (>=2.21,<3.0)", "jinja2 (>=2.10,<3.0)", "inflection (>=0.3.1,<0.4.0)", "dataclasses-json (>=0.2.0,<0.3.0)", "aiohttp (>=3.5,<4.0); extra == \"async\"", "watchdog (>=0.9.0,<0.10.0)" ], "requires_python": ">=3.7,<4.0", "summary": "Python GraphQL Client Library", "version": "0.1.1" }, "last_serial": 4865903, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e0f119c9903b8cc60b12467e4a52b53a", "sha256": "189f2ac00b206753b5079003f0c27377ba5a0ab6737438364a70a044c806b6a2" }, "downloads": -1, "filename": "gql_next-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e0f119c9903b8cc60b12467e4a52b53a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 28450, "upload_time": "2019-02-25T17:44:00", "url": "https://files.pythonhosted.org/packages/36/cf/e0d49f16f069d55991ef76620762a28abf09b00b653df06feb5a67b00054/gql_next-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "655bf9814e9e8f9fd3a860fe5addc352", "sha256": "7c27ad4ed06b87950991c392387bbd4525b6a266c23731002c892f8fb6c8c383" }, "downloads": -1, "filename": "gql-next-0.1.1.tar.gz", "has_sig": false, "md5_digest": "655bf9814e9e8f9fd3a860fe5addc352", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 10187, "upload_time": "2019-02-25T17:43:59", "url": "https://files.pythonhosted.org/packages/36/ec/5413b0cf71059f5f066cfd1a664fe85cd3283965f6c1eb88e5e287e83d19/gql-next-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e0f119c9903b8cc60b12467e4a52b53a", "sha256": "189f2ac00b206753b5079003f0c27377ba5a0ab6737438364a70a044c806b6a2" }, "downloads": -1, "filename": "gql_next-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e0f119c9903b8cc60b12467e4a52b53a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 28450, "upload_time": "2019-02-25T17:44:00", "url": "https://files.pythonhosted.org/packages/36/cf/e0d49f16f069d55991ef76620762a28abf09b00b653df06feb5a67b00054/gql_next-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "655bf9814e9e8f9fd3a860fe5addc352", "sha256": "7c27ad4ed06b87950991c392387bbd4525b6a266c23731002c892f8fb6c8c383" }, "downloads": -1, "filename": "gql-next-0.1.1.tar.gz", "has_sig": false, "md5_digest": "655bf9814e9e8f9fd3a860fe5addc352", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 10187, "upload_time": "2019-02-25T17:43:59", "url": "https://files.pythonhosted.org/packages/36/ec/5413b0cf71059f5f066cfd1a664fe85cd3283965f6c1eb88e5e287e83d19/gql-next-0.1.1.tar.gz" } ] }