A very simple GraphQL API and GraphQL Client for contacts stored on a local postgres database.
- JDK version 11.0.11 or above
- Maven version 3.6.3 or above
- PostgreSQL server version 13.4 or above
-
Clone the repository on your machine
-
Start the PostgreSQL server on your local machine. If you are accessing the PostgreSQL server over a network, edit the property
quarkus.datasource.reactive.url
in the fileapplication.properties
and replacelocalhost
with the server IP address. -
Connect to your PostgreSQL server using a user like that has create DB and create user privileges, like
postgres
. -
Run the script
init.sql
on the PostgreSQL server. This script will create a userquarkustest
with passwordsqlquarkustest
and a databasequarkustest
. -
To run the GraphQL API, execute the
run_graphql_api.sh
script. It will launch the quarkus in dev mode at port 5005, and GraphQL API will be available athttp://localhost:8080/graphql
. -
To test the GraphQL endpoints, load the file SimpleContactsGraphQL.postman_collection.json in Postman and execute the API calls.
-
To run the GraphQL Client, execute the
run_graphql_client.sh
script. It will launch the quarkus in dev mode at port 5006, and GraphQL API query results will be available athttp://localhost:8081/dynamic
. -
To test the subscription of GraphQL client, visit the URL
http://localhost:8081/dynamic/subscription
, and try adding new contacts using Postman.