{ "info": { "author": "Anon Ray", "author_email": "rayanon004@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Other Environment", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries" ], "description": "# py-graphql-client\nDead-simple to use GraphQL client over websocket. Using the\n[apollo-transport-ws](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md)\nprotocol.\n\n## Examples\n\n### Setup subscriptions super easily\n\n```python\nfrom graphql_client import GraphQLClient\n\nws = GraphQLClient('ws://localhost:8080/graphql')\ndef callback(_id, data):\n print(\"got new data..\")\n print(f\"msg id: {_id}. data: {data}\")\n\nquery = \"\"\"\n subscription {\n notifications {\n id\n title\n content\n }\n }\n\"\"\"\nsub_id = ws.subscribe(query, callback=callback)\n...\n# later stop the subscription\nws.stop_subscribe(sub_id)\nws.close()\n```\n\n### Variables can be passed\n\n```python\nfrom graphql_client import GraphQLClient\n\nws = GraphQLClient('ws://localhost:8080/graphql')\ndef callback(_id, data):\n print(\"got new data..\")\n print(f\"msg id: {_id}. data: {data}\")\n\nquery = \"\"\"\n subscription ($limit: Int!) {\n notifications (order_by: {created: \"desc\"}, limit: $limit) {\n id\n title\n content\n }\n }\n\"\"\"\nsub_id = ws.subscribe(query, variables={'limit': 10}, callback=callback)\n```\n\n### Normal queries and mutations work too\n\n```python\nfrom graphql_client import GraphQLClient\n\nws = GraphQLClient('ws://localhost:8080/graphql')\nquery = \"\"\"\n query ($limit: Int!) {\n notifications (order_by: {created: \"desc\"}, limit: $limit) {\n id\n title\n content\n }\n }\n\"\"\"\nres = ws.query(query, variables={'limit': 10})\nprint(res)\nws.close()\n```\n\n\n## TODO\n- currently wss doesn't not work. support wss.\n- tests\n- support http as well\n- should use asyncio websocket library?\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": "https://github.com/ecthiender/py-graphql-client", "keywords": "graphql,websocket", "license": "BSD3", "maintainer": "", "maintainer_email": "", "name": "py-graphql-client", "package_url": "https://pypi.org/project/py-graphql-client/", "platform": "", "project_url": "https://pypi.org/project/py-graphql-client/", "project_urls": { "Homepage": "https://github.com/ecthiender/py-graphql-client" }, "release_url": "https://pypi.org/project/py-graphql-client/0.1.0/", "requires_dist": [ "websocket-client (==0.54.0)" ], "requires_python": ">=3.4", "summary": "A dead-simple graphql client that supports subscriptions over websockets.", "version": "0.1.0" }, "last_serial": 4969900, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "07dbe333b56ffdd4222e5795494e93c4", "sha256": "655079369151c29a35fc20a46dce3d26430de9443046a2256391cd9afed2f820" }, "downloads": -1, "filename": "py_graphql_client-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "07dbe333b56ffdd4222e5795494e93c4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4107, "upload_time": "2019-03-21T20:38:56", "url": "https://files.pythonhosted.org/packages/a9/d9/70df2c0f0bcce2f54028f77d814b923c2c0264f3bc7bc81871993536823b/py_graphql_client-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5e9bdf4b2d35b46f46af2afa870ca6d0", "sha256": "98605b4a65ada09fca9f3a30c40c056af3032885ac35d9e821ee3ec76e9e81bf" }, "downloads": -1, "filename": "py-graphql-client-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5e9bdf4b2d35b46f46af2afa870ca6d0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3068, "upload_time": "2019-03-21T20:38:58", "url": "https://files.pythonhosted.org/packages/79/95/4a33fba3d74710c680ee6c9e8f3cde26641baff119358c28e75fda1cf995/py-graphql-client-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "07dbe333b56ffdd4222e5795494e93c4", "sha256": "655079369151c29a35fc20a46dce3d26430de9443046a2256391cd9afed2f820" }, "downloads": -1, "filename": "py_graphql_client-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "07dbe333b56ffdd4222e5795494e93c4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4107, "upload_time": "2019-03-21T20:38:56", "url": "https://files.pythonhosted.org/packages/a9/d9/70df2c0f0bcce2f54028f77d814b923c2c0264f3bc7bc81871993536823b/py_graphql_client-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5e9bdf4b2d35b46f46af2afa870ca6d0", "sha256": "98605b4a65ada09fca9f3a30c40c056af3032885ac35d9e821ee3ec76e9e81bf" }, "downloads": -1, "filename": "py-graphql-client-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5e9bdf4b2d35b46f46af2afa870ca6d0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3068, "upload_time": "2019-03-21T20:38:58", "url": "https://files.pythonhosted.org/packages/79/95/4a33fba3d74710c680ee6c9e8f3cde26641baff119358c28e75fda1cf995/py-graphql-client-0.1.0.tar.gz" } ] }