My team needs to add load testing for our GraphQL API, and we decided to use JMeter because it is supported by Azure Load Testing.
We have several graphql files that define queries like this:
request.graphql
query Foo($id: Long!) {
name
time
}
With corresponding test.json files used for unit testing that defines the query name, variables for the request, and an assert that contains the expected response from our API
request.test.json
[
{
"Query": "Foo",
"Variables": {
"id": 001
},
"Assert": {
"name": "bar",
"time": "01/01/1999"
}
}
]
We have dozens of these unit tests that we want to use for load testing our API using JMeter. How would we dynamically load our queries, variables, and assertions using JMeter, and load that into Azure Load Testing?
This is currently my very basic test plan with one graphql HTTP request. I want to avoid manually adding every single query, so that the queries in load tests get updated when a graphql and test.json file gets changed for our API.