Skip to content

Files

Latest commit

b89ba9b · May 17, 2022

History

History
41 lines (34 loc) · 1.86 KB

api-management-graphql-test.md

File metadata and controls

41 lines (34 loc) · 1.86 KB
ms.service ms.topic author ms.author ms.date ms.custom
api-management
include
dlepow
danlep
05/10/2022

Test your GraphQL API

  1. Navigate to your API Management instance.

  2. From the side navigation menu, under the APIs section, select APIs.

  3. Under All APIs, select your GraphQL API.

  4. Select the Test tab to access the test console.

  5. Under Headers:

    1. Select the header from the Name drop-down menu.
    2. Enter the value to the Value field.
    3. Add more headers by selecting + Add header.
    4. Delete headers using the trashcan icon.
  6. If you've added a product to your GraphQL API, apply product scope under Apply product scope.

  7. Under Query editor, either:

    1. Select at least one field or subfield from the list in the side menu. The fields and subfields you select appear in the query editor.

    2. Start typing in the query editor to compose a query.

      :::image type="content" source="media/api-management-graphql-test/test-graphql-query.png" alt-text="Screenshot of adding fields to the query editor.":::

  8. Under Query variables, add variables to reuse the same query or mutation and pass different values.

  9. Select Send.

  10. View the Response.

    :::image type="content" source="media/api-management-graphql-test/graphql-query-response.png" alt-text="Screenshot of viewing the test query response.":::

  11. Repeat preceding steps to test different payloads.

  12. When testing is complete, exit test console.

Note

You can test a subscription in the test console:

  • Set up a subscription query in the query editor, and then select Connect to establish a WebSocket connection to the backend service.
  • Review connection details in the Subscription pane.
  • The WebSocket connection is maintained until you disconnect it or you connect to a new WebSocket subscription.