Skip to content

andretadeu/book-details

Repository files navigation

book-details

Example on how to use GraphQL

How to test

Firstly, we should use Docker Compose to run PostgreSQL container:

docker-compose up -d

then, run the following commands:

gradle clean build
java -jar build/libs/book-details-0.0.1-SNAPSHOT.jar -Dspring.profiles.active=local

finally, run the cURL command to test:

curl 'http://localhost:8080/graphql' -H 'Content-Type: application/json' -H 'Accept: application/json' --data @test-graphql-insert.txt

for the insert and:

curl 'http://localhost:8080/graphql' -H 'Content-Type: application/json' -H 'Accept: application/json' --data '{"query":"{\n  bookById(isbn: \"123-1234567890\"){\n    isbn\n    title\n    pageCount\n}}"}'

for the retrieve.

In Progress

There is a simple React application form to insert data using this backend. You must have the latest Node LTS version. To start it, please do:

cd src/client
npm start

About

Example of use GraphQL, Spring Boot and React.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published