tyrellshawn / spring-graphql-sample

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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-java GraphQL Java vanilla Spring Boot example
graphql-kotlin ExpediaGroup Graphql Kotlin Spring Boot example
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)
graphql-spqr GraphQL SPQR Spring 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

Prerequisites

Make sure you have installed the following software.

  • Java 17
  • 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

License:GNU General Public License v3.0


Languages

Language:Java 68.4%Language:Kotlin 29.4%Language:TypeScript 1.8%Language:JavaScript 0.2%Language:HTML 0.2%Language:CSS 0.0%