Skip to content

Latest commit

History

130 Commits

Folders and files

NameName
Last commit message
Last commit date

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

typeLinks {
quality: Stringlink: String
}

Downloads

typeDownloads {
english: [Links]
hindi: [Links]
subbed: [Links]
}

Movie

typeMovie {
_id: ID!movieName: String!movieDescription: String!movieThumbnail: String!releaseYear: Int!movieDirectors: [String!]
movieTags: [String!]!movieShots: [String!]
movieReview: StringmovieDownloads: Downloads
}

Show

typeShow {
showName: String!seasonNum: String!showDescription: String!showThumbnail: String!showCreators: [String!]
showTags: [String!]
showShots: [String!]
showReview: StringshowEpisodes: [Episode!]!
}

Episode

typeEpisode {
downloads: DownloadsepisodeId: String!episodeName: StringepisodeNum: String
}

Tag

typeTag {
tagName: String!tagDescription: String!tagMovies: InttagShows: Int
}

User

typeUser {
userName: String!userEmail: String!password: String!
}

Queries

Movies Query

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

queryGetMovies($year: Int, $tag: String, $page: Int, $limit: Int, $name: String) {
Movies(year: $year, tag: $tag, page: $page, limit: $limit, name: $name) {
_idmovieNamemovieDescriptionreleaseYearmovieTags
}
}

Movie Query

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

queryGetMovie($id: ID, $name: String, $tag: String) {
Movie(id: $id, name: $name, tag: $tag) {
_idmovieNamemovieDescriptionmovieThumbnail
}
}

Shows Query

Fetch shows with optional pagination and filtering by tag.

queryGetShows($tag: String, $page: Int, $limit: Int) {
Shows(tag: $tag, page: $page, limit: $limit) {
showNameseasonNumshowDescription
}
}

Show Query

Fetch a specific show by ID or name.

queryGetShow($id: ID, $name: String) {
Show(id: $id, name: $name) {
showNameshowDescriptionshowEpisodes {
episodeName
}
}
}

Tags Query

Fetch all available tags.

queryGetTags {
Tags {
tagNametagDescription
}
}

Tag Query

Fetch details for a specific tag.

queryGetTag($tag: String) {
Tag(tag: $tag) {
tagNametagDescription
}
}

Mutations

CreateMovie

Add a new movie to the database.

mutationCreateNewMovie($movie: IMovie) {
CreateMovie(movie: $movie) {
movieNamereleaseYear
}
}

CreateShow

Add a new show to the database.

mutationCreateNewShow($show: IShow) {
CreateShow(show: $show) {
showNameseasonNum
}
}

UpdateMovieThumbnail

Update the thumbnail of a specific movie.

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

UpdateEpisode

Add or update an episode for a show.

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

DeleteMovie

Delete a movie by its ID.

mutationRemoveMovie($id: ID) {
DeleteMovie(id: $id) {
movieName
}
}

UpdateMovieShots

Update screenshots for a movie.

mutationUpdateShots($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) {
movieNamereleaseYear
}
}

Add a New Movie

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

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

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages