A server-side Kotlin application Demo
- Kotlin 1.7
- Maven
- JVM 17
- Spring Web Flux - Annotation-based reactive components
- GraphQL
- Log4j-api-kotlin
# Clone this repository
$ git clone https://github.com/guilhermezamoner/demo-webflux-graphql.git
# Run the app
$ ./mvnw spring-boot:run
Start service and open in browser http://localhost:8080/graphiql?path=/graphql to open GraphiQL IDE
# Get All Players
query {
getAllPlayers {
id
name
age
club
nationality
}
}
# Get players by club
query {
getPlayersByClub(club: "Liverpool") {
id
name
age
club
nationality
}
}
# Get player by name
query {
getPlayerByName(name: "Casemiro") {
id
name
age
club
nationality
}
}
# Add player
mutation addPlayer ($player: PlayerInput!) {
addPlayer(player: $player) {
id
name
age
club
nationality
}
}
# Variables:
{
"player":
{
"name": "Silva",
"age": 29,
"club": "Man City",
"nationality": "Portugal"
}
}