Skip to content

Explore the world of movies and TV shows with Binge, a React-GraphQL APP designed to provide seamless access to an extensive collection of entertainment data. Whether you're building a movie recommendation app, creating a TV show tracking platform, or enhancing your media-related project, Binge is your gateway to a treasure trove of information.

Notifications You must be signed in to change notification settings

Sandeep5521/Binge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

BingeQL Documentation

BingeQL is a GraphQL API built using Node.js, Express, and MongoDB. It provides a robust backend for managing movies, shows, tags, and users. This API is used by Binge, a React web app deployed on Vercel. The API endpoint is hosted at https://bingeql.onrender.com/graphql. This document provides an overview of the API schema, queries, mutations, and sample usage.

Table of Contents

Schema Overview

Types

Links

type Links {
  quality: String
  link: String
}

Downloads

type Downloads {
  english: [Links]
  hindi: [Links]
  subbed: [Links]
}

Movie

type Movie {
  _id: ID!
  movieName: String!
  movieDescription: String!
  movieThumbnail: String!
  releaseYear: Int!
  movieDirectors: [String!]
  movieTags: [String!]!
  movieShots: [String!]
  movieReview: String
  movieDownloads: Downloads
}

Show

type Show {
  showName: String!
  seasonNum: String!
  showDescription: String!
  showThumbnail: String!
  showCreators: [String!]
  showTags: [String!]
  showShots: [String!]
  showReview: String
  showEpisodes: [Episode!]!
}

Episode

type Episode {
  downloads: Downloads
  episodeId: String!
  episodeName: String
  episodeNum: String
}

Tag

type Tag {
  tagName: String!
  tagDescription: String!
  tagMovies: Int
  tagShows: Int
}

User

type User {
  userName: String!
  userEmail: String!
  password: String!
}

Queries

Movies Query

Fetch movies based on filters like release year, tag, name, page, and limit.

query GetMovies($year: Int, $tag: String, $page: Int, $limit: Int, $name: String) {
  Movies(year: $year, tag: $tag, page: $page, limit: $limit, name: $name) {
    _id
    movieName
    movieDescription
    releaseYear
    movieTags
  }
}

Movie Query

Fetch a specific movie by ID, name, or tag.

query GetMovie($id: ID, $name: String, $tag: String) {
  Movie(id: $id, name: $name, tag: $tag) {
    _id
    movieName
    movieDescription
    movieThumbnail
  }
}

Shows Query

Fetch shows with optional pagination and filtering by tag.

query GetShows($tag: String, $page: Int, $limit: Int) {
  Shows(tag: $tag, page: $page, limit: $limit) {
    showName
    seasonNum
    showDescription
  }
}

Show Query

Fetch a specific show by ID or name.

query GetShow($id: ID, $name: String) {
  Show(id: $id, name: $name) {
    showName
    showDescription
    showEpisodes {
      episodeName
    }
  }
}

Tags Query

Fetch all available tags.

query GetTags {
  Tags {
    tagName
    tagDescription
  }
}

Tag Query

Fetch details for a specific tag.

query GetTag($tag: String) {
  Tag(tag: $tag) {
    tagName
    tagDescription
  }
}

Mutations

CreateMovie

Add a new movie to the database.

mutation CreateNewMovie($movie: IMovie) {
  CreateMovie(movie: $movie) {
    movieName
    releaseYear
  }
}

CreateShow

Add a new show to the database.

mutation CreateNewShow($show: IShow) {
  CreateShow(show: $show) {
    showName
    seasonNum
  }
}

UpdateMovieThumbnail

Update the thumbnail of a specific movie.

mutation UpdateThumbnail($movieId: ID, $thumbnail: String) {
  UpdateMovieThumbnail(movieId: $movieId, thumbnail: $thumbnail) {
    movieThumbnail
  }
}

UpdateEpisode

Add or update an episode for a show.

mutation UpdateShowEpisode($showId: ID, $episode: IEpisode) {
  UpdateEpisode(showId: $showId, episode: $episode) {
    episodeName
  }
}

DeleteMovie

Delete a movie by its ID.

mutation RemoveMovie($id: ID) {
  DeleteMovie(id: $id) {
    movieName
  }
}

UpdateMovieShots

Update screenshots for a movie.

mutation UpdateShots($movieId: ID, $screenShots: String) {
  UpdateMovieShots(movieId: $movieId, screenShots: $screenShots) {
    movieShots
  }
}

Authentication

A valid token is required for most mutations. The token can be retrieved using the Token query and should be passed as a Bearer token in the Authorization header.

Sample Queries and Mutations

Fetch Movies by Tag

query {
  Movies(tag: "Action", limit: 5, page: 1) {
    movieName
    releaseYear
  }
}

Add a New Movie

mutation {
  CreateMovie(movie: {
    movieName: "Inception",
    releaseYear: 2010,
    movieDescription: "A mind-bending thriller.",
    movieTags: ["Sci-Fi", "Thriller"],
    movieThumbnail: "inception.jpg"
  }) {
    movieName
    releaseYear
  }
}

Delete a Movie

mutation {
  DeleteMovie(id: "63f12d8d8f1f2a0012345678") {
    movieName
  }
}

For more details, explore the schema and experiment with queries and mutations using tools like GraphQL Playground or Postman.

About

Explore the world of movies and TV shows with Binge, a React-GraphQL APP designed to provide seamless access to an extensive collection of entertainment data. Whether you're building a movie recommendation app, creating a TV show tracking platform, or enhancing your media-related project, Binge is your gateway to a treasure trove of information.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages