GraphQL books API made using Spring Boot and DGS. This is a sibling project of the Book Project.
Prerequisites:
- JDK 11 or higher
- Configure Lombok
- PostgreSQL 12 or (better) Docker
- For Linux users, install docker-compose
- For macOS and Windows users, install Docker Desktop
Recommended IntelliJ plugin: JS GraphQL
- Import as a Maven project into your favourite IDE
- Start the MySQL Database or run the docker-compose file
docker-compose up -d
(you may need to addsudo
to this command)- If using macOS or Windows, you'll need to first ensure Docker Desktop is running
- Run
BooksApiApplication.java
- Go to
localhost:8080/graphiql
Sample query:
{
findAllBooks {
title
authors {
fullName
}
genre
isbn13
yearOfPublication
format
}
}
To access the PostgreSQL database when docker-compose/Docker desktop is running, use the follow credentials in your favourite client:
- Host:
localhost
- Port:
5432
- User:
dbuser
- Password:
dbpassword
- URL:
jdbc:postgresql://localhost:5432/booksapi
For example, in IntelliJ ultimate or DataGrip:
If you wish to contribute (thanks!), please first see the contributing document.