-
Run the application using
gradle bootRun
-
Open
http://localhost:8080/graphiql
in browser
- Query Employee
{
employees {
id
name
salary
}
}
and inside REQUEST HEADERS
{
"Authorization": "Basic YWRtaW46YWRtaW4="
}
Response :
{
"data": {
"employees": [
{
"id": "1",
"name": "Andi",
"salary": "42"
}
]
}
}
gradle build
gradle jibDockerBuild
docker run -d -p 8080:8080 ashutoshsahoo/gs-graphql
docker ps
docker stop <container-id>
docker rm <container-id>
For further reference, please consider the following sections:
- Spring-GraphQL
- Spring-GraphQL-Github
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Spring Boot DevTools
- Spring Web
- Spring Security
- Spring Data JPA
- Spring Boot Actuator
- Jib - Containerize your Gradle Java project
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
- Securing a Web Application
- Spring Boot and OAuth2
- Authenticating a User with LDAP
- Accessing Data with JPA
- Building a RESTful Web Service with Spring Boot Actuator
These additional references should also help you: