Test GraphQL Endpoints via the GraphQL Console¶
Choreo provides an integrated GraphQL Console to test publicly exposed GraphQL endpoints of Service components you create and deploy. The GraphQL Console allows you to write queries and mutations interactively. As Choreo uses OAuth2.0 authentication by default to secure GraphQL APIs, the GraphQL Console generates test keys to test APIs.
Follow the steps below to test a GraphQL endpoint via the GraphQL Console:
Sign in to the Choreo Console.
In the Component Listing pane, click on the component you want to test.
Click Test in the left navigation menu and then click Console. This opens the GraphQL Console pane.
In the GraphQL Console pane, select the environment from the drop-down list.
Select the required endpoint from the Endpoint list.
- The Network Visibility of an endpoint is set in the endpoints.yaml. You can set it to Public, Organization, or Project.
- If you have set the Network Visibility of the endpoint in the endpoints.yaml to Public, continue with step 7.
- If you have set the Network Visibility of the endpoint in the endpoints.yaml to Organization, the GraphQL endpoint will not be invokable from outside the organization. In this instance, for testing purposes, Choreo allows you to generate a temporay test URL that will be active for 15 minutes. Execute step 6 to generate the temporary URL.
If the Network Visibility of the endpoint is set to Organization, click on Generate URL to generate a temporary test URL that will be active for 15 minutes. Else, skip this step.
The temporay test URL will be available only for 15 minutes and it will get expired after. You can deactivate the test URL by clicking on the Deactivate URL button.
Enter the API path and the query or mutation you want to test.
Click the play icon.
If you want to generate a required query or mutation for testing via the GraphQL Explorer, click Explorer to open the GraphQL Explorer.