This repository contains spring-boot + graphql-java example using awesome kotlin language
query people endpoint
echo '{"query":"{ people { id name } }"}' | http post :8080 HTTP/1.1 200 # skip headers... { "data": { "people": [ { "id": 1, "name": "Max" }, { "id": 2, "name": "Bax" }, { "id": 3, "name": "Fax" } ] } }
query person by it’s id
echo '{"query":"{ person(id: \"1\") { name addressId } }"}' | http post :8080 HTTP/1.1 200 # skip headers { "data": { "person": { "addressId": 1, "name": "Max" } } }
build and run using maven wrapper
mvn -N io.takari:maven:wrapper bash mvnw package spring-boot:run # or bash mvnw package -DskipTests; java -jar target/*.jar
build and run using gradle wrapper
gradle wrapper bash gradlew build bRun # or bash gradlew as; bash build/libs/*.jar