Spring Graphql Samples

Spring Graphql Reactive Samples With Jwt Authentication

Spring Boot Graphql Samples


GraphQL is a query language and server-side runtime for application programming interfaces (APIs) that prioritizes giving clients exactly the data they request and no more. GraphQL is designed to make APIs fast, flexible, and developer-friendly. It can even be deployed within an integrated development environment (IDE) known as GraphiQL. As an alternative to REST, GraphQL lets developers construct requests that pull data from multiple data sources in a single API call.


  • Java 17
  • Kotlin
  • Maven 3.x


You can install the dependencies and build by typing the following command

mvn clean install


You can run application’s tests by typing the following command

mvn verify

Code Quality

You can test code quality locally via sonarqube by typing the following command

mvn -Psonar compile initialize sonar:sonar


Detekt a static code analysis tool for the Kotlin programming language

You can run detekt by typing the following command

mvn antrun:run@detekt


rsc --stream --route=graphql --dataMimeType="application/graphql+json" --data='{"query":"subscription { postAdded { id, title, content } }" }' --debug tcp://localhost:8079 --authBearer ${TOKEN} 
rsc --request --route=graphql --dataMimeType="application/graphql+json" --data='{"query":"{ post(id: \"632c8028feb9e053546a88f2\") { id, title } }" }' --debug tcp://localhost:8079  --authBearer ${TOKEN} 


View Github