Skip to content

Instantly share code, notes, and snippets.

@chrisl777
Last active April 27, 2018 22:28
Show Gist options
  • Save chrisl777/d2dedd272a17db0a25e23773bb90a77f to your computer and use it in GitHub Desktop.
Save chrisl777/d2dedd272a17db0a25e23773bb90a77f to your computer and use it in GitHub Desktop.
A simple GraphQL server-side schema containing Movie info with Genre.
type Query {
movie(id: ID!): Movie
}
type Movie {
id: ID! @isUnique
title: String!
budget: Int
popularity: Float!
tagline: String
overview: String
status: String
runtime: Int
release_date: String
vote_average: Float
vote_count: Int
poster_path: String
backdrop_path: String
genres: [Genre] @relation(name: "MovieGenres")
}
type Genre @model {
id: ID! @isUnique
name: String!
movie: Movie! @relation(name: "MovieGenres")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment