54

GitHub - xxczaki/omdb-graphql-wrapper: GraphQL wrapper for the OMDb API

 5 years ago
source link: https://github.com/xxczaki/omdb-graphql-wrapper
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

OMDb API GraphQL Wrapper

Easily use OMDb API with GraphQL ?

Demo ?


Setup a server:

  1. Clone this repository
  2. Run npm install
  3. Get the OMDb API key and paste it in the config.json file
  4. Run npm run dev to start the server in the development mode
  5. Go to localhost:2121 and play with the GraphQL Playground
  6. If you want to build the server, run npm run build and then npm start to start the server from the recently created dist directory.

Usage

Check out the GraphQL documentation first!

Queries

Using the movie title:

{
  ByTitle(title: "Matrix") {
    Title
    Year
    Rated
    Plot
    Genre
  }
}

Using IMDb ID

{
  ById(id: "100") {
    Director
    Actors
    Country
  }
}

Fields:

Title

Returns: string

Title of the movie/tv show

Year

Returns: string

Year the movie was released

Rated

Returns: string

Movie rating (eg. 12+)

Released

Returns: string

Full date of release

Runtime

Returns: string

Runtime of the movie

Genre

Returns: string

Genre(s) of the movie

Director

Returns: string

Movie Director(s)

Writer

Returns: string

Movie Writer(s)

Actors

Returns: string

Actors

Plot

Returns: string

Plot

Language

Returns: string

Language(s)

Country

Returns: string

Country or countries where the movie was made

Awards

Returns: string

Awards

Poster

Returns: string

Link to a movie poster

Metascore

Returns: string

Metascore

imdbRating

Returns: string

Rating from IMDb

imdbVotes

Returns: string

Number of votes from IMDb

Type

Returns: string

Type (movie, tv show etc.)

DVD

Returns: string

DVD release date

BoxOffice

Returns: string

Box Office

Production

Returns: string

Production company

Website

Returns: string

Website of the movie

Response

Returns: string

Check, if there was a response from OMDb

License

MIT


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK