This GraphQL API consumes SWAPI - The Star Wars API.
./gradlew bootRun
"Permission denied" on Mac, Ubuntu, etc. please run the following in terminal:
chmod +x gradlew
Set enviorment variables per instructions for your operating system.
Open these in your favourite browser after running the project.
These additional references should also help you:
We will query the server with GraphQL queries
- Query for all films with fields title and producer
- Query for all films with fields title, openingcrawl and releaseDate
- Query for all films with fields title, vehicles (vehicles with at least two subfields: model and manufaturer).
- Query for all reviews
- Query for film with id 3
- Give a name to the query from assignment 5
- Change the value 3 with a variable
We will fill in code to get the GraphQL API to work as it did in assignment 1.
Before we continue, please change branch
git branch del-2
Add these queries to Playground after the project is up and running.
# All films with reviews
{
films {
episodeId
title
reviews {
username
diceThrow
}
}
}
#Film episode 4 with review
{
film(id: 4) {
episodeId,
title,
openingCrawl,
director,
producer,
releaseDate,
reviews {
username
diceThrow
}
}
}
#Film episode 4 with vehicle and review
{
film(id: 4) {
episodeId,
title,
openingCrawl,
director,
producer,
releaseDate,
vehicles {
name
passengers
cargo_capacity
maxAtmospheringSpeed
}
reviews {
username
diceThrow
}
}
}
# Vehicle with properties
{
vehicle(id: 8) {
name
passengers
cargo_capacity
maxAtmospheringSpeed
}
}
# Multation for creating a review
mutation {
createReview(review: {id: 3, username: "SontUser123", diceThrow: 6}) {
id
username
diceThrow
}
}
# Play and describe a sound effect
{
audio {description}
}