# Introduction to GraphQL with Postman

By
The Quable Team

GraphQL is a query language for APIs that allows you to request exactly the data you need. In Postman, you can create GraphQL requests to interact with your APIs.

This guide covers the basic concepts, how to make your first request, and the specific features of the Postman interface for handling GraphQL requests.

# Making Your First GraphQL Request

# Setting Up the Request

  1. Select the Request Type: In the "Body" tab of Postman, choose "GraphQL".
  2. Enter the Query: Type your GraphQL query in the designated field. For example:
    {
      documents(id: "my-id") {
        id
        attributes
      }
    }
  3. Query Variables: Define query variables under the query field to pass dynamic data.

# Sending the Request

Click "Send" to send the request. The server's response will be displayed in the response section.

# Postman Interface for GraphQL

Postman offers several tools to facilitate working with GraphQL:

  1. Auto-completion: Helps with the entry of fields and data types.
  2. Schema Explorer: Allows you to visually navigate through the GraphQL schema.
  3. Request History: Keeps a record of your requests for easy reuse.

# Executing HTTP Requests with GraphQL

GraphQL requests are often sent via POST, with the body containing the GraphQL query and optionally variables. You can manage necessary headers, such as authentication tokens, in the headers section of Postman.

# Going Further!

Postman is a powerful tool for testing and interacting with GraphQL APIs. It provides a user-friendly interface for creating, modifying, and sending requests, along with advanced features like auto-completion and schema exploration.

For more information, you can check out the official Postman resources: