Spring Boot, GraphQL template project with batteries included.
- Docker 🐳 configuration for production deployment, development and test
- Remote debugging for development mode
- JDK 1.8
- Or docker + docker-compose
- Download and install Lombok plugin
- Enable Annotation Processors
- Go to Setting->Build, Execution, Deployment-> Compiler->Annotation Processors
- Check Enable annotation processing
- Download and install GraphQLJs plugin
- You can download "CheckStyle plugin". Then open Settings > Other Settings > Checkstyle. Add path to check-style.xml file and provide link to check-style folder in "${configDir}". This will display errors in editor and it wont affect build/run.
- As default behaviour it is configured to call "checkstyleMain pmdMain" before "build" task is executed, which does not prevent development (application start up and bootrun)
1.1. Run
- Gradle:
$ gradlew bootRun
- Docker:
$ docker-compose up
(or$ docker-compose up --build
if image should be rebuilt)
1.2. Debug
Run remote debugger from IDE. Debug port is 5005
- Gradle:
$ gradlew test
- Docker:
$ docker-compose -f docker-compose.test.yml up --build
- Gradle:
$ gradlew buld
- Docker:
$ docker build -t spring-boot-graphql-template .
Assuming that the Docker image is already built on the previous step
- Docker (add
-d
to run in daemon mode):$ docker run -p 8080:8080 spring-boot-graphql-template
- Spring Boot : Application framework
- Feign : HTTP Client library
- Feign-Hystrix : wraps Feign's http requests in Hystrix, which enables the Circuit Breaker pattern.
- Lombok : Utility library for Java language
- GraphQL : API query runtime
- GraphQL Voyager : Represent any GraphQL API as an interactive graph. See Voyager Sample
- GraphQL Playground : GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration). See Playground Sample
- Docker
- Use the Models and Connectors pattern to structure our GraphQL server code, since it is a well established pattern in GraphQL world. Such approach allows to refer to the existing approach instead of coming up with our own set of guidelines.