demo.mov
Star Wars REST API at http://swapi.co/ to demonstrate a GraphQL Server running on Express.
The following NPM modules are required in package.json:
- express
- express-graphql
- graphql
- axios
- dataloader
- nodemon
Install with:
npm install
npm start
You can run these queries within GraphiQL
localhost: 3000 / graphql;
query {
film (id:"1") {
title,
director
}
}
query {
vehicle(id: "8") {
name
}
}
query {
starship(id:"5") {
name
}
}
query {
species(id:"1") {
name
}
}
query {
planet(id: "1") {
name
}
}
query {
character (id: "1") {
name,
height,
mass,
hair_color,
skin_color,
eye_color,
birth_year,
gender,
homeworld {
name
rotation_period
orbital_period
diameter
climate
gravity
terrain
surface_water
population
residents {
name
birth_year
gender
}
created
edited
},
films {
title
director
},
species {
name,
classification,
designation,
language,
people {
name
birth_year
gender
},
films {
title
director
}
}
vehicles{
name,
model,
cost_in_credits,
length,
crew,
passengers,
vehicle_class,
pilots {
name
},
films {
title
}
}
starships{
name,
model,
cost_in_credits,
length,
crew,
passengers,
hyperdrive_rating,
starship_class,
pilots {
name
},
films {
title
}
}
created,
edited
}
}