mirror of
https://github.com/n8n-io/n8n-docs.git
synced 2025-11-20 17:48:34 +00:00
| .. | ||
| README.md | ||
| workflow.png | ||
| permalink | description |
|---|---|
| /nodes/n8n-nodes-base.graphql | Learn how to use the GraphQL node in n8n |
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.
The final workflow should look like the following image.
1. Start node
The start node exists by default when you create a new workflow.
2. GraphQL node
- Enter
https://api.spacex.land/graphql/in the Endpoint field. - Select the 'JSON' option from the Request Format dropdown list.
- Enter the GraphQL query shown below in the Query field.
- Click on Execute Node to run the workflow.
GraphQL query
{
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
}
}
}
