Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 871 Bytes

Step07.md

File metadata and controls

38 lines (27 loc) · 871 Bytes

Step 07 : Define an API in GraphQL

To implement our GraphQL API, we are going to use GraphQL Java and GraphQL Java Spring Boot.

Adding necessary dependencies

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!]
}

What's next

In the next step, we will...