MikaelBrenner / the-office-graphql

GraphQL interface for The Office API, based on Nest.js and Axios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the-office-graphql

Description

A GraphQL interface for The Office API, powered by Nest.js and Axios.

Running the API

You can use docker-compose to run the application:

$ docker-compose up -d # the -d option runs the containers in the background

Or simply run it with Yarn:

yarn start:dev

This starts the server at the port defined by the PORT environmental variable, defaulting to the 3000 port if none is set.

Usage

The GraphQL Playground(and server) can be accessed at the /graphql endpoint, and the available resolvers are:

  • characters
  • crew
  • episodes
  • quotes

The available fields will be hinted by the Playground, and this is an example query that get data from all of them:

query{
  characters{
    firstname
    lastname
  }
  crew {
    name
    role
  }
  episodes {
    title
    writer{
      name
    }
  }
  quotes {
    content
    character {
      firstname
    }
  }
}

About

GraphQL interface for The Office API, based on Nest.js and Axios


Languages

Language:TypeScript 91.7%Language:JavaScript 6.9%Language:Dockerfile 1.4%