Skip to content

hantsy/spring-graphql-sample

Repository files navigation

spring-graphql-sample

Spring GraphQL examples using the following frameworks and libraries:

Other GraphQL Java integration examples with Java frameworks.

Guide

TBD

Example Codes

Example name Description
dgs Simple Netflix DGS example
dgs-webflux Simple Netflix DGS example with Spring WebFlux
dgs-subscription-ws Simple Netflix DGS Subscription example using WebSocket protocol
dgs-subscription-ui Angular Client app for dgs-subscription-ws
dgs-subscription-sse Simple Netflix DGS Subscription example using Http/SSE protocol
dgs-codegen Netflix DGS example with Spring Jdbc and Gradle codegen plugin
dgs-fileupload Netflix DGS file upload example
dgs-client Netflix DGS Typesafe Client example
dgs-kotlin-co A complete Netflix DGS example with WebFlux, Kotlin Coroutines, Spring Data R2dbc and Spring Security
dgs-kotlin A complete Netflix DGS example with WebMvc/Kotlin, Spring Data Jdbc, Spring Security and Spring Session/Spring Data Redis
graphql-kotlin ExpediaGroup Graphql Kotlin Spring Boot example
spring-graphql Spring GraphQL example
spring-graphql-webmvc Spring GraphQL with WebMvc Controller annotation example
spring-graphql-querydsl Spring GraphQL/JPA/QueryDSl Data Fetchers example
spring-graphql-webflux Spring GraphQL/WebFlux example with WebSocket transport protocol
spring-graphql-rsocket-kotlin-co Spring GraphQL/WebFlux/Kotlin Coroutines example with RSocket transport protocol

Legacy Codes

Some example codes are moved to legacy folder, because the upstream project is discontinued or under an inactive development status.

Example name Description
graphql-java GraphQL Java vanilla Spring Boot example, upstream project is discontinuned, replaced by Spring GraphQL
graphql-spqr GraphQL SPQR Spring example, inactive
graphql-java-kickstart GraphQL Java Kickstart Spring Boot example
graphql-java-kickstart-webclient GraphQL Java Kickstart Spring WebClient example
graphql-java-kickstart-annotations GraphQL Java Kickstart Spring Boot example(Code first)

Prerequisites

Make sure you have installed the following software.

  • Java 21
  • Apache Maven 3.8.x / Gradle 7.x
  • Docker

Some sample codes are written in Kotlin. If you are new to Kotlin, start to learn it from the the Kotlin homepage.

Build

Clone the source codes from Github.

git clone https://github.com/hantsy/spring-graphql-sample/

Open a terminal, and switch to the root folder of the project, and run the following command to build the whole project.

docker-compose up postgres // start up a postgres it is required
cd examplename // change to the example folder
mvn clean install // build the project
//or
./gradlew build

Run the application.

mvn spring-boot:run 
//or 
./gradlew bootRun
// or from command line after building
java -jar target/xxx.jar

Contribution

Any suggestions are welcome, filing an issue or submitting a PR is also highly recommended.

References

About

Spring GraphQL examples using Netflix DGS, GraphQL Java and Spring GraphQL

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published