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.
type Links {
quality: String
link: String
}
type Downloads {
english: [Links]
hindi: [Links]
subbed: [Links]
}
type Movie {
_id: ID!
movieName: String!
movieDescription: String!
movieThumbnail: String!
releaseYear: Int!
movieDirectors: [String!]
movieTags: [String!]!
movieShots: [String!]
movieReview: String
movieDownloads: Downloads
}
type Show {
showName: String!
seasonNum: String!
showDescription: String!
showThumbnail: String!
showCreators: [String!]
showTags: [String!]
showShots: [String!]
showReview: String
showEpisodes: [Episode!]!
}
type Episode {
downloads: Downloads
episodeId: String!
episodeName: String
episodeNum: String
}
type Tag {
tagName: String!
tagDescription: String!
tagMovies: Int
tagShows: Int
}
type User {
userName: String!
userEmail: String!
password: String!
}
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
}
}
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
}
}
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
}
}
Fetch a specific show by ID or name.
query GetShow($id: ID, $name: String) {
Show(id: $id, name: $name) {
showName
showDescription
showEpisodes {
episodeName
}
}
}
Fetch all available tags.
query GetTags {
Tags {
tagName
tagDescription
}
}
Fetch details for a specific tag.
query GetTag($tag: String) {
Tag(tag: $tag) {
tagName
tagDescription
}
}
Add a new movie to the database.
mutation CreateNewMovie($movie: IMovie) {
CreateMovie(movie: $movie) {
movieName
releaseYear
}
}
Add a new show to the database.
mutation CreateNewShow($show: IShow) {
CreateShow(show: $show) {
showName
seasonNum
}
}
Update the thumbnail of a specific movie.
mutation UpdateThumbnail($movieId: ID, $thumbnail: String) {
UpdateMovieThumbnail(movieId: $movieId, thumbnail: $thumbnail) {
movieThumbnail
}
}
Add or update an episode for a show.
mutation UpdateShowEpisode($showId: ID, $episode: IEpisode) {
UpdateEpisode(showId: $showId, episode: $episode) {
episodeName
}
}
Delete a movie by its ID.
mutation RemoveMovie($id: ID) {
DeleteMovie(id: $id) {
movieName
}
}
Update screenshots for a movie.
mutation UpdateShots($movieId: ID, $screenShots: String) {
UpdateMovieShots(movieId: $movieId, screenShots: $screenShots) {
movieShots
}
}
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.
query {
Movies(tag: "Action", limit: 5, page: 1) {
movieName
releaseYear
}
}
mutation {
CreateMovie(movie: {
movieName: "Inception",
releaseYear: 2010,
movieDescription: "A mind-bending thriller.",
movieTags: ["Sci-Fi", "Thriller"],
movieThumbnail: "inception.jpg"
}) {
movieName
releaseYear
}
}
mutation {
DeleteMovie(id: "63f12d8d8f1f2a0012345678") {
movieName
}
}
For more details, explore the schema and experiment with queries and mutations using tools like GraphQL Playground or Postman.