Writing GraphQL queries
Prerequisites#
- Adequate prior knowledge of GraphQL end-points and Queries.
Directions#
- Select the POST method from the Method drop-down list.
- Set this SpaceX GraphQL API end-point
https://api.spacex.land/graphqlin theURLbarinput. - Select the
GraphQL queriesitem the Quick Body Type Selection section. - Input a below query payload inside the Request Panel.
query launchesDetails{ __typename launches { details id is_tentative launch_date_local launch_date_unix launch_date_utc launch_site { site_id site_name } launch_success launch_year }}- Hit the
Sendbutton in the URL bar to send your GraphQL request. - Observe the response in the
Response Panel.
This process is similar to that of sending an API request to the server, except the payload is a GraphQL query.