Skip to content

Instantly share code, notes, and snippets.

@Cema2019
Last active July 16, 2025 21:15
Show Gist options
  • Select an option

  • Save Cema2019/f4e5f6451766600b0c13545445725fc1 to your computer and use it in GitHub Desktop.

Select an option

Save Cema2019/f4e5f6451766600b0c13545445725fc1 to your computer and use it in GitHub Desktop.
GRAPHQL PRACTICE - STAR WARS PLAYGROUND CHALLENGE
query GetAllPeople {
allPeople {
people {
birthYear
eyeColor
gender
hairColor
name
vehicleConnection {
vehicles {
cargoCapacity
model
name
passengers
vehicleClass
}
}
species {
created
designation
eyeColors
}
homeworld {
gravity
name
}
}
}
}

Create a Query named GetAllPeople that will retrieve the following information:

Using the magic of GraphQL, We will retrieve some of the existing Connections for this StarWars Playground . Let's start by fetching the "people" data from an API Playground. We'll retrieve fields like birthYear, eyeColor, gender, hairColor, home-world (gravity, name), skinColor, species (created, designation, eyeColors), name, vehicleConnection, and vehicles (cargoCapacity, model, name, passengers, vehicleClass). This public API offers a lot of fun, and you'll see how quickly we can build a query to display the required data in our apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment