This is a ten-percent project to explore the possibilities of GraphQL in the Content API.
- Get hold of the
content-apirepository and follow the instructions there to set up a local docker-based Elasticsearch instance and restore a CAPI snapshot into it.
sbt run
(or do the same in your favourite debugger)
- To view the schema, go to http://localhost:9000/schema/content
- To make a GraphQL request, go to http://localhost:9000/query. You will need to "fake" the Kong authentication
header, set a header called
X-Consumer-Usernameto the value:internal(note the:) in order for the API to work.
I've included a basic build of GraphiQL in the explorer/ subdirectory.
In order to use this, simply:
- Make sure you have a recent version of node.js installed along with the
yarnpackage manager cd exploreryarn && yarn start- Wait for it to build
- Go to http://localhost:8080 in your browser
- If it complains about a network error, check you have the backend running with
sbt runor similar - Enjoy
