Skip to main content
All CollectionsIntegrationsGraphQL
Using your PlusPlus GraphiQL for Exploring Your GraphQL APIs
Using your PlusPlus GraphiQL for Exploring Your GraphQL APIs

Learn how to effectively use GraphiQL to explore, query, and debug your GraphQL APIs with this step-by-step guide and example queries.

Michael Wallace avatar
Written by Michael Wallace
Updated over 3 months ago

Using GraphiQL

GraphiQL is an in-browser IDE for exploring GraphQL.

  1. Access GraphiQL:

    1. Navigate to customerdomain.plusplus.app/graphql in your browser.

  2. Enter Your Query:

    1. In the left panel, type your GraphQL query. For example:

    2. query {
      events(first: 150, starts_at_after: "20240101T000000-0400", tag: ["Workplace"]) {
      edges {
      node {
      pk
      name
      tags
      url
      cover
      }
      }
      }
      }

  3. Execute the Query:

    1. Click the "Execute Query" button (▶️ icon). The response will appear in the right panel.

  4. Explore the Schema:

    1. Click the "Docs" button on the right side to explore available queries and mutations.

      1. Nodes: Objects that represent individual items in a list (e.g., each event in a list of events).

      2. Strings: Textual data (e.g., "Workplace").

      3. Booleans: True or false values (e.g., true or false).

      4. Int: Integer numbers (e.g., 150).

      5. IDs: Unique identifiers for objects (e.g., pk for primary key).

What is a Query?

A GraphQL query is a request for data from a GraphQL server. Here's a breakdown of the example query:

query {
events(first: 150, starts_at_after: "20240101T000000-0400", tag: ["Workplace"]) {
edges {
node {
pk
name
tags
url
cover
}
}
}
}
  • Query: The keyword query indicates that we are asking for data.

    • events: The root field we are querying. It can take requests like first, starts_at_after, and tag.

      • first: 150: We are requesting the first 150 events.

      • starts_at_after: "20240101T000000-0400": We are filtering events that start after January 1, 2024.

      • tag: ["Workplace"]: We are filtering events that have the tag "Workplace".

    • edges: GraphQL often represents lists as edges and nodes. The edges field contains an array of edge objects.

    • node: Each edge has a node which represents the actual event data.

      • pk: The primary key (ID) of the event.

      • name: The name of the event.

      • tags: Tags associated with the event.

      • url: The URL of the event.

      • cover: The cover image or media of the event.

This structure allows you to request specific fields and filter data according to your needs, ensuring you only get the relevant information.

Wrap-Up

Using GraphiQL provides a powerful and intuitive way to interact with your GraphQL APIs. By navigating to your "domain.app/graphql", you can easily write and execute queries to fetch the data you need. With a clear understanding of GraphQL concepts such as nodes, strings, booleans, integers, and IDs, you can efficiently explore and manipulate your data. The example query demonstrates how to request specific fields and filter results to tailor the response to your needs. GraphiQL’s built-in documentation and schema exploration tools further enhance your ability to develop and debug queries, making it an indispensable tool for any GraphQL developer.

Did this answer your question?