A simple GraphQL API server sample for shibuya.apk #17
npm install --save
node server.js
The server starts running on localhost: http://localhost:4000/graphql
- allMovies: [Movie!]
{
allMovies {
id
title
year
rating
}
}
- movie(id: ID!): Movie
{
movie(id:"8e989b68-34a6-40ca-a33b-e0b7f7420cdc") {
id
title
year
rating
}
}
- addMovie(movie: MovieInput!): Movie!
mutation addMovie($movie: MovieInput!) {
addMovie(movie: $movie) {
id
}
}
{
"movie": {
"title": "The Shining",
"year": 1980,
"rating": 8.4
}
}
See GraphiQL Documentation Explorer for more details.