A GraphQL version of the popular Star Wars REST API
- Node.js - JavaScript Runtime Environment
- Express - Web framework
- GraphQL - Query Language
- Apollo Server 2 - GraphQL Server
- Babel - Transpiler/Transcompiler
1. Install Dependencies
npm install
2. Start Server
npm run server
3. Execute GraphQL Queries Here (Browser Automatically Opens On Server Start)
http://localhost:4000/graphql
The full schema can be viewed by clicking on the green "Schema" button on the right side.
Get All Star Wars Films
{
getAllFilms {
count
previous
next
results {
title
episode_id
opening_crawl
director
producer
release_date
characters
planets
starships
vehicles
species
created
edited
url
}
}
}
Get Star Wars Film By ID
{
getFilmById(id: 1) {
title
episode_id
opening_crawl
director
producer
release_date
characters
planets
starships
vehicles
species
created
edited
url
}
}