Skip to content

mightyfrog/Simple-GraphQL-API-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-GraphQL-API-Server

A simple GraphQL API server sample for shibuya.apk #17

Download dependencies:

npm install --save

Start GraphQL API server:

node server.js

The server starts running on localhost: http://localhost:4000/graphql

Queries:

  • allMovies: [Movie!]
{
  allMovies {
    id
    title
    year
    rating
  }
}
  • movie(id: ID!): Movie
{
  movie(id:"8e989b68-34a6-40ca-a33b-e0b7f7420cdc") {
    id
    title
    year
    rating
  }
}

Mutation:

  • 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.

About

A simple GraphQL API server sample for shibuya.apk #17

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published