Skip to content

sourcelabs-nl/qnh-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL + Spring Boot example application

This is a Spring Boot based GraphQL sample application written in Kotlin.

You can use this example to easily setup your own GraphQL application.

This project consists of two (maven) modules:

  • stubs: containing Spring Cloud Contract files for generation of WireMock stubs

  • application: GraphQL example application written in Kotlin using GraphQL Java Tools and the com.graphql-java-kickstart and the provided Spring Boot started modules: graphql-spring-boot-starter.

Getting started with GraphQL and Spring Boot

  • Create project a Spring Boot project using Spring Initializer

  • Add graphql-spring-boot-starters

Queries and mutations

Example query:

query {
  orderById(id: "1") {
    totalPrice
    items {
      status
      productId
    }
  }
}

Example slow query:

query {
  orderById(id: "1") {
    totalPrice
    items {
      status
      productId
      product {
        title
      }
    }
  }
}

Example mutation query:

mutation {
  cancelOrderItem(orderItemCancellation: {orderId: "1", orderItemId: "1", reason: "I dont want it!"} ) {
    id
    status
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published