graphql-python/gql

Locust compatibility/example

fescobar opened this issue · 2 comments

Hi @leszekhanusz
First I would like to thank you for this great project.
I'm planning to create a client with gql where I'm going to create multiple methods (mutations/queries) to facilitate the integration with my graphql server.

I would like to reuse theses methods from the client to test the performance of the application. One of the most used tools for that is Locust (https://docs.locust.io/en/stable/quickstart.html).
I'm trying to reuse the methods from the GQL client created but Locust has a different type of Client to work properly.

I wanted to know if there is any way to achieve that? and if that is possible if there is an example

This is the basic implementation from Locust.

from locust import HttpUser, task

class HelloWorldUser(HttpUser):
    @task
    def hello_world(self):
        self.client.get("/hello")
        self.client.get("/world")

Thank you in advance.

Sorry, gql could be used in a lot of tools and frameworks and there is no specific examples for them.
I feel like this issue is better suited as a Stackoverflow question as it is not a specific problem about gql.
Don't hesitate to open another issue if you actually have an issue about a problem with gql itself.

No problem @leszekhanusz
I found a way to do it with requests
Thank you