Skip to content
This repository was archived by the owner on Jul 14, 2021. It is now read-only.

An example of GraphQL server written with Play and sangria

License

Notifications You must be signed in to change notification settings

DevPhilB/sangria-playground

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork of Sangria playground

This is a fork of an example of a GraphQL server written with Play framework and Sangria. It also serves as a playground.
On the right hand side you can see a textual representation of the GraphQL schema which is implemented on the server and that you can query here.
On the left hand side you can execute a GraphQL queries and see the results of its execution.

This is just a small demonstration. It really gets interesting when you start to play with the schema on the server side. Fortunately it's pretty easy to do. Since it's a simple Play application, all it takes to start playground locally and start playing with the schema is this:

$ git clone https://github.com/DevPhilB/sangria-playground.git
$ cd sangria-playground
$ sbt run

Now you are ready to point your browser to http://localhost:9000. The only prerequisites are SBT and Java 8.

Added some queries and mutations for demonstration.

query ListAllHumans {
  humans {
    id, name, friends {name}, appearsIn, homePlanet
  }
}

mutation AddObiWanKenobiToHumans {
  createHuman(
    id: "1005", 
    name: "Obi-Wan Kenobi",
    friends: ["1000"],
    episode: [NEWHOPE, EMPIRE, JEDI],
    homeplanet: "Tatooine"
  ) {
    id, name, friends {name}, appearsIn, homePlanet
  }
}

About

An example of GraphQL server written with Play and sangria

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.5%
  • HTML 0.3%
  • CSS 0.1%
  • Scala 0.1%
  • LiveScript 0.0%
  • Makefile 0.0%