Skip to content

GraphQL#

GraphQL is an open-source data query and manipulation language for APIs, and a runtime for fulfilling queries with existing data.

Basic Operations#

  • Query a GraphQL endpoint

Example Usage#

This workflow allows you to get information about the five most recent SpaceX launches from spacex.land. You can also find the workflow on the website. This example usage workflow uses the following two nodes. - Start - GraphQL

The final workflow should look like the following image.

A workflow with the GraphQL node

1. Start node#

The start node exists by default when you create a new workflow.

2. GraphQL node#

  1. Enter https://api.spacex.land/graphql/ in the Endpoint field.
  2. Select the 'JSON' option from the Request Format dropdown list.
  3. Enter the GraphQL query shown below in the Query field.
  4. Click on Execute Node to run the workflow.

GraphQL query#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
  launchesPast(limit: 5) {
    mission_name
    launch_date_local
    launch_site {
      site_name_long
    }
    links {
      article_link
      video_link
    }
    rocket {
      rocket_name
      first_stage {
        cores {
          flight
          core {
            reuse_count
            status
          }
        }
      }
      second_stage {
        payloads {
          payload_type
          payload_mass_kg
          payload_mass_lbs
        }
      }
    }
    ships {
      name
      home_port
      image
    }
  }
}