Testing Endpoints

GraphQL testing allows you to validate and debug your queries, mutations, and subscriptions by sending requests to your QueryDeck endpoint. You can use Postman to efficiently test and interact with the GraphQL APIs.

Prerequisites

  • Ensure you have the GraphQL endpoint (e.g., https://your-querydeck-url/graphql).

  • Postman installed on your system (or use the web version).

Steps to Test GraphQL APIs in Postman

  1. Open Postman Launch Postman and create a new request.

  2. Set Request Type to POST GraphQL queries are sent via HTTP POST requests. Select POST from the dropdown.

  3. Enter the GraphQL Endpoint Paste the QueryDeck GraphQL endpoint in the request URL (e.g., https://your-querydeck-url/graphql).

  1. Configure Headers Ensure the following headers are set:

Content-Type: application/json Authorization: Bearer YOUR_ACCESS_TOKEN (see authentication and authorization section for more info)

give some sample query for testing

eg:

{
    "query": "query GetFilms    {\n  film {\n        title\n    description\n    release_year\n    language_id\n    rental_duration\n    rental_rate\n        replacement_cost\n    rating\n    fulltext\n  }\n}",
    "variables": {}
}

Now hit send, and wait for response

Your response should be in a format like the sample below

Last updated