{ "info": { "author": "rohitghatol", "author_email": "", "bugtrack_url": null, "classifiers": [], "description": "# GraphQL Client for Locust\n\nLocust is a python performance test library. Locust supports http client out of the box.\nThis library provides the GraphQL Client for Locust.\n\nThis GraphQL Client is based on Prisma's Simple GraphQL Client for Python (https://github.com/prisma/python-graphql-client)\n\n# API\n\n```python\nclass GraphQLClient:\n def execute(self, label, query, variables=None, type ='graphql'):\n```\n\n####Arguments\n* type = Locust Request Type. Default value is 'graphql'\n* label = Locust Name\n* query = GraphQL Query\n* variables = GraphQL Variables. Default value is None\n\n\n# Usage\n\n```python\nfrom locust import HttpLocust, TaskSet, task\nfrom locustgraphqlclient import GraphQLLocust\n\n\nclass UserBehavior(TaskSet):\n def on_start(self):\n \"\"\" on_start is called when a Locust start before any task is scheduled \"\"\"\n self.login()\n\n def on_stop(self):\n \"\"\" on_stop is called when the TaskSet is stopping \"\"\"\n self.logout()\n\n def login(self):\n query = '''\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password) {\n access_token\n }\n }'''\n variables = {\n 'username': 'gm',\n 'password': 'centric8'\n }\n result = self.client.execute(\"login\", query, variables)\n\n # Inject the Access Token in the Client, so subsequent requests can be made\n self.client.inject_token(result['data']['login']['access_token'])\n\n def logout(self):\n # Reset the Access Token in the Client, so no subsequent requests can be made\n self.client.inject_token('')\n\n @task(2)\n def index(self):\n query = '''\n query products {\n products {\n id\n name\n image\n }\n }'''\n result = self.client.execute(\"products\", query)\n\n @task(1)\n def profile(self):\n query = '''\n query me {\n me {\n id\n username\n firstName\n lastName \n }\n }'''\n result = self.client.execute(\"me\", query)\n\n\nclass WebsiteUser(GraphQLLocust):\n task_set = UserBehavior\n min_wait = 5000\n max_wait = 9000\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/rohitghatol/locust-graphql-client", "keywords": "", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "locust-graphql-client", "package_url": "https://pypi.org/project/locust-graphql-client/", "platform": "", "project_url": "https://pypi.org/project/locust-graphql-client/", "project_urls": { "Homepage": "https://github.com/rohitghatol/locust-graphql-client" }, "release_url": "https://pypi.org/project/locust-graphql-client/0.3.4/", "requires_dist": null, "requires_python": "", "summary": "Locust GraphQL client GraphQL. This is a GraphQLLocust equivalent of HttpLocust", "version": "0.3.4" }, "last_serial": 5856482, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "102f83005694a3148b55a6df4fafa06c", "sha256": "d9fa1887e7471604ca70989cd87c5916d9bf626190d41ef44fd16f773af635eb" }, "downloads": -1, "filename": "locust-graphql-client-0.1.1.tar.gz", "has_sig": false, "md5_digest": "102f83005694a3148b55a6df4fafa06c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2319, "upload_time": "2019-08-26T03:21:46", "url": "https://files.pythonhosted.org/packages/a2/ac/cfd33428541d469384e215f25088f43aca9583fdec3ddb1e6951c1193533/locust-graphql-client-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "e6f7064f3e681d2391a9afe4451d3f47", "sha256": "086ee37f6e34b1fd80fc8fc7c45422e639bf154a287c16bc4732bc3e64388c0c" }, "downloads": -1, "filename": "locust-graphql-client-0.2.0.tar.gz", "has_sig": false, "md5_digest": "e6f7064f3e681d2391a9afe4451d3f47", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2338, "upload_time": "2019-08-26T04:12:41", "url": "https://files.pythonhosted.org/packages/c4/57/33969b9942feb7352c2306fa0057eb7781bbd326247b50a0f0e3cc90efb9/locust-graphql-client-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "da3eda7cfd1b7816b416a74290e483e7", "sha256": "d8b658bb74c81cab1152ba1fa2a11ec453ffc349a40bad9504acf9113bae4cec" }, "downloads": -1, "filename": "locust-graphql-client-0.3.0.tar.gz", "has_sig": false, "md5_digest": "da3eda7cfd1b7816b416a74290e483e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2447, "upload_time": "2019-08-26T05:33:58", "url": "https://files.pythonhosted.org/packages/be/ac/3cebff45ef46d970e64d7efd70a097bcd111371809434aa13e4d54712ea1/locust-graphql-client-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "4e4026b7a89a293fc00e88a8a4d45f0e", "sha256": "1f07995c9b9b8745ef1807608229b133279cc7875085e61ee88890e0b31c5eb1" }, "downloads": -1, "filename": "locust-graphql-client-0.3.1.tar.gz", "has_sig": false, "md5_digest": "4e4026b7a89a293fc00e88a8a4d45f0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2441, "upload_time": "2019-09-18T19:23:51", "url": "https://files.pythonhosted.org/packages/1e/6d/dffa1c78b93b1fe2b8e1c45dd73a86b268dee5a925df9e3a9ea38ba9556e/locust-graphql-client-0.3.1.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "e6fc68a03b7ec355fe5b70fd2d3517ed", "sha256": "b351c3e456b3739e442a34480df98b2de5838682486da4af59c021d1c62fc566" }, "downloads": -1, "filename": "locust-graphql-client-0.3.4.tar.gz", "has_sig": false, "md5_digest": "e6fc68a03b7ec355fe5b70fd2d3517ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2486, "upload_time": "2019-09-19T13:42:13", "url": "https://files.pythonhosted.org/packages/fd/f6/1c86dc0729e95106624b80cf6b2edb354261e3261386e4d61f6058731470/locust-graphql-client-0.3.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e6fc68a03b7ec355fe5b70fd2d3517ed", "sha256": "b351c3e456b3739e442a34480df98b2de5838682486da4af59c021d1c62fc566" }, "downloads": -1, "filename": "locust-graphql-client-0.3.4.tar.gz", "has_sig": false, "md5_digest": "e6fc68a03b7ec355fe5b70fd2d3517ed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2486, "upload_time": "2019-09-19T13:42:13", "url": "https://files.pythonhosted.org/packages/fd/f6/1c86dc0729e95106624b80cf6b2edb354261e3261386e4d61f6058731470/locust-graphql-client-0.3.4.tar.gz" } ] }