GraphQL Requests
GraphQL requests send queries or mutations. This topic describes how to work with them in ReadyAPI. To learn more about GraphQL services, see GraphQL Testing.
You specify a GraphQL query or mutation at the top panel of the Request tab:
![]() |
In the Query Variables panel, you specify variables. To learn how to use variables in GraphQL, see the GraphQL documentation.
Use property expansions
You can use property expansions for both variables and query or mutation. To insert a property expansion:
Right-click within the editor where you want to add a property expansion and select Get Data:
In Get Data, select the needed property and click Add.
ReadyAPI inserts the required property expansion:
Change the method
GraphQL queries support the POST and GET methods. To change the method, select it from the drop-down list at the top:
![]() |
Note
GraphQL mutations support only the POST method.
Validation
ReadyAPI can validate GraphQL requests and responses against a schema.
When you add a GraphQL schema to your project, ReadyAPI generates queries and mutations existing in the schema. All the requests under these queries and mutations, as well as test step based on these requests, will have links to the schema, so ReadyAPI can validate if the specified query or mutation is correct:
![]() |
Important
ReadyAPI cannot validate requests under the manually added queries and mutations.
Validate requests
To validate a request, click Validate in the Request panel:
![]() |
ReadyAPI goes through types and fields in a query and checks if the type has the specified fields.
Validate a response
To validate a response, right-click the response within the JSON panel and select Validate:
![]() |
ReadyAPI checks the JSON syntax and verifies if the data the service includes in the response corresponds with the requested fields:
![]() |
GraphQL request properties
GraphQL request properties define how ReadyAPI handles specific GraphQL requests.
![]() |
Name | Description |
---|---|
Name | The name of the request. |
Description | An arbitrary text describing the request. |
Encoding | The type of request data encoding – for example, |
Endpoint | The address of the GraphQL service (including the port number). ImportantThe host cannot contain underscores. |
Timeout | The number of milliseconds to wait for the server response. If no data arrives within the specified time period, the request is considered to fail. If the value is 0 or is not specified, the wait time is infinite. |
Bind Address | The network interface (an IP address), through which ReadyAPI will send the request. |
Follow Redirects | If |
SSL Keystore | Specifies the file storing private keys that are used to authorize ReadyAPI to the server. Only works for HTTPS requests. |
Dump File | The path to the file where responses will be saved. If empty, responses are discarded. |
Max Size | The maximum size of responses to be saved. |