When you add a GraphQL API, ReadyAPI shows its parts in the Navigator panel:
![]() |
This section describes how you can manage GraphQL APIs in ReadyAPI. To learn basic information on testing GraphQL services in ReadyAPI, see GraphQL Testing.
A GraphQL service is a top-level node of the GraphQL services in the Navigator panel. Select it to see and modify added queries, mutations, endpoints, and the service’s schema:
![]() |
The Endpoints page is the central place where you manage endpoints used in the GraphQL API.
![]() |
You can configure the following options:
Option | Description |
---|---|
Endpoint | The endpoint URL or destination. ImportantThe host cannot contain underscores. |
Environment | An environment associated with the endpoint. ImportantYou can create only one endpoint associated with each environment. When you add a new endpoint associated to the same environment, the new endpoint will overwrite the existing one. ImportantNo Environments should be selected if you need to hit different endpoints in the same test case. The base API will remain the same but will also allow for flexibility when configuring the requests contained in the functional tests. |
Authorization Profile | An authorization profile used to access the endpoint. |
When you do not use an environment, you can assign any endpoint that is not associated with an environment to GraphQL API requests. In this case, the request or test step will send a request to the specified endpoint. Once you change the endpoint, it will be updated in all the requests and test steps using it:
![]() |
When you set an environment, all the API requests and test steps will use the endpoint associated with this environment:
![]() |
The Specification page shows the GraphQL schema: defined types, queries and mutations. This information helps you build queries and mutations.
To quickly navigate through the schema, use the navigation tree on the left.
Queries and mutations are grouped in the Navigator under the nodes with the same names: Queries and Mutations.
![]() |
For each query and mutation, you create one or more requests, each of them may fetch a different set of data from the service or specify different parameters for mutations.
Add query or mutation
To add a query or a mutation:
Click
next to the Queries or Mutations node:
— or —
Right-click the Queries or Mutations node in the Navigator and select New GraphQL Query or New GraphQL Mutation:
Add GraphQL request
To add a GraphQL request:
In the Navigator, click
next to the query or mutation to which you want to add a request:
— or —
Right-click the query or mutation node in the Navigator and select New Request:
To learn more about GraphQL requests, see GraphQL Requests.
You can reorganize elements of the GraphQL API: queries, mutations, and requests.
To rename an item:
Select it in the Navigator panel and press F2.
– or –
Right-click it in the Navigator panel and select Rename.
Renaming items does not affect the API definition, it affects only the item representation in ReadyAPI.
Important
Renaming the service in a composite project will change the matching folder name.
To delete an item:
Select it in the Navigator panel and press Shift+Delete.
– or –
Right-click the item in the Navigator and select Delete.
In ReadyAPI terms, cloning means creating an exact copy of an item. To clone test steps, test cases, or test suites:
In the Navigator panel, press Ctrl and drag the desired test step, case, or suite to a new location.
– or –
Right-click the request and select Clone Request.
To create a test suite and test cases based on the service definition, do the following:
Click
next to the service and select Generate Test Suite from the flyout menu.
–or–
Right-click the service and select Generate Test Suite.
Use the Generate Test Suite dialog to configure how ReadyAPI should create test cases:
Test Suite – Specifies the test suite to which the created test cases will be added.
Style – Specifies how ReadyAPI organizes the created test cases:
One test case for each resource – ReadyAPI creates REST Request test steps for each method in the selected resources and organizes them into several test cases.
Single test case with one request for each method – ReadyAPI creates REST Request test steps for each method in the selected resources and organizes them into a single test case.
Queries – Selects queries to generate test cases.
Mutations – Selects mutations to generate test cases.
Create Load Test – Specifies whether ReadyAPI creates a load test for each created test case.
Click OK.
ReadyAPI will create new test cases and name them based on the definition.