jefelewis / swapi-rest-api-to-graphql

GraphQL version of the popular Star Wars REST API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL Star Wars API

A GraphQL version of the popular Star Wars REST API

Built Using:

Getting Started:

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

View GraphQL Schema:

The full schema can be viewed by clicking on the green "Schema" button on the right side. Schema

Example Queries:

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
  }
}

About

GraphQL version of the popular Star Wars REST API

License:MIT License


Languages

Language:JavaScript 100.0%