To implement our GraphQL API, we are going to use GraphQL Java and GraphQL Java Spring Boot.
Open build.gradle and add some dependencies
dependencies {
implementation 'com.graphql-java:graphql-java:11.0'
implementation "com.graphql-java:graphql-java-spring-boot-starter-webflux:1.0"
implementation 'com.google.guava:guava:26.0-jre'
[...]
}
Then add a file schema.graphql
in src/main/resources
with the following content:
type InventoryItem {
id: ID!
name: String!
quantity: Int!
}
type Inventory {
items: [InventoryItem!]
}
In the next step, we will...