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.
typeLinks {
quality: Stringlink: String
}typeDownloads {
english: [Links]
hindi: [Links]
subbed: [Links]
}typeMovie {
_id: ID!movieName: String!movieDescription: String!movieThumbnail: String!releaseYear: Int!movieDirectors: [String!]
movieTags: [String!]!movieShots: [String!]
movieReview: StringmovieDownloads: Downloads
}typeShow {
showName: String!seasonNum: String!showDescription: String!showThumbnail: String!showCreators: [String!]
showTags: [String!]
showShots: [String!]
showReview: StringshowEpisodes: [Episode!]!
}typeEpisode {
downloads: DownloadsepisodeId: String!episodeName: StringepisodeNum: String
}typeTag {
tagName: String!tagDescription: String!tagMovies: InttagShows: Int
}typeUser {
userName: String!userEmail: String!password: String!
}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
}
}Fetch a specific movie by ID, name, or tag.
queryGetMovie($id: ID, $name: String, $tag: String) {
Movie(id: $id, name: $name, tag: $tag) {
_idmovieNamemovieDescriptionmovieThumbnail
}
}Fetch shows with optional pagination and filtering by tag.
queryGetShows($tag: String, $page: Int, $limit: Int) {
Shows(tag: $tag, page: $page, limit: $limit) {
showNameseasonNumshowDescription
}
}Fetch a specific show by ID or name.
queryGetShow($id: ID, $name: String) {
Show(id: $id, name: $name) {
showNameshowDescriptionshowEpisodes {
episodeName
}
}
}Fetch all available tags.
queryGetTags {
Tags {
tagNametagDescription
}
}Fetch details for a specific tag.
queryGetTag($tag: String) {
Tag(tag: $tag) {
tagNametagDescription
}
}Add a new movie to the database.
mutationCreateNewMovie($movie: IMovie) {
CreateMovie(movie: $movie) {
movieNamereleaseYear
}
}Add a new show to the database.
mutationCreateNewShow($show: IShow) {
CreateShow(show: $show) {
showNameseasonNum
}
}Update the thumbnail of a specific movie.
mutationUpdateThumbnail($movieId: ID, $thumbnail: String) {
UpdateMovieThumbnail(movieId: $movieId, thumbnail: $thumbnail) {
movieThumbnail
}
}Add or update an episode for a show.
mutationUpdateShowEpisode($showId: ID, $episode: IEpisode) {
UpdateEpisode(showId: $showId, episode: $episode) {
episodeName
}
}Delete a movie by its ID.
mutationRemoveMovie($id: ID) {
DeleteMovie(id: $id) {
movieName
}
}Update screenshots for a movie.
mutationUpdateShots($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) {
movieNamereleaseYear
}
}mutation {
CreateMovie(movie: {
movieName: "Inception",
releaseYear: 2010,
movieDescription: "A mind-bending thriller.",
movieTags: ["Sci-Fi", "Thriller"],
movieThumbnail: "inception.jpg"
}) {
movieNamereleaseYear
}
}mutation {
DeleteMovie(id: "63f12d8d8f1f2a0012345678") {
movieName
}
}For more details, explore the schema and experiment with queries and mutations using tools like GraphQL Playground or Postman.