kotlin-spring-boot-graphql-example
book.graphqls
type Book {
publicId: ID!,
title: String,
author: String
}
type Query {
books(size: Int!):[Book]
book(publicId: ID!):Book
}
type Mutation {
createBook(title: String!, author: String!):Book
updateBook(publicId: ID!, title: String!, author: String!):Book
deleteBook(publicId: ID!): ID
}
/graphql
Example: http://localhost:8080/graphql
/graphiql
Example: http://localhost:8080/graphiql
More info: https://github.com/graphql/graphiql
/altair
Example: http://localhost:8080/altair
More info: https://github.com/imolorhe/altair
/voyager
Example: http://localhost:8080/voyager
More info: https://github.com/APIs-guru/graphql-voyager
git clone https://github.com/wojciech-zurek/kotlin-spring-boot-graphql-example.git
cd kotlin-spring-boot-graphql-example/
./gradlew bootRun
cd kotlin-spring-boot-graphql-example/
./gradlew bootJar
java -jar build/libs/kotlin-spring-boot-graphql-example-0.0.1-SNAPSHOT.jar
cd kotlin-spring-boot-graphql-example/
./gradlew cleanTest test