Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daggerok/boot-graphql
This repository contains spring-boot + graphql-java example
https://github.com/daggerok/boot-graphql
gradle graphql graphql-java h2-database kotlin maven spring-boot
Last synced: 16 days ago
JSON representation
This repository contains spring-boot + graphql-java example
- Host: GitHub
- URL: https://github.com/daggerok/boot-graphql
- Owner: daggerok
- Created: 2017-11-12T11:16:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-14T22:08:49.000Z (about 7 years ago)
- Last Synced: 2024-11-11T15:40:37.376Z (3 months ago)
- Topics: gradle, graphql, graphql-java, h2-database, kotlin, maven, spring-boot
- Language: Kotlin
- Homepage:
- Size: 159 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
Awesome Lists containing this project
README
= GraphQL | Spring Boot image:https://travis-ci.org/daggerok/boot-graphql.svg?branch=master["Build Status", link="https://travis-ci.org/daggerok/boot-graphql"]
This repository contains spring-boot + graphql-java example using awesome kotlin language
== graphql
.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"
}
}
}
----== maven
.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
----== gradle
.build and run using gradle wrapper
----
gradle wrapper
bash gradlew build bRun
# or bash gradlew as; bash build/libs/*.jar
----== rtfm
. link:https://docs.spring.io/spring-data/rest/docs/current/reference/html/#_the_hal_browser[hap browser]