https://github.com/zbhavyai/simple-contacts-api
A very simple GraphQL API and GraphQL Client for contacts stored on a local postgres database
https://github.com/zbhavyai/simple-contacts-api
graphql mutiny postgresql quarkusio
Last synced: 7 months ago
JSON representation
A very simple GraphQL API and GraphQL Client for contacts stored on a local postgres database
- Host: GitHub
- URL: https://github.com/zbhavyai/simple-contacts-api
- Owner: zbhavyai
- Created: 2022-04-10T08:08:23.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-09T01:21:30.000Z (over 3 years ago)
- Last Synced: 2025-01-27T22:46:16.897Z (8 months ago)
- Topics: graphql, mutiny, postgresql, quarkusio
- Language: Java
- Homepage:
- Size: 239 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GraphQL API and Subscriptions demo
A very simple GraphQL API and GraphQL Client for contacts stored on a local postgres database.
## Dependencies
- JDK version 11.0.11 or above
- Maven version 3.6.3 or above
- PostgreSQL server version 13.4 or above## How to run
1. Clone the repository on your machine
2. 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 file `application.properties` and replace `localhost` with the server IP address.
3. Connect to your PostgreSQL server using a user like that has create DB and create user privileges, like `postgres`.
4. Run the script [`init.sql`](documents/init.sql) on the PostgreSQL server. This script will create a user `quarkustest` with password `sqlquarkustest` and a database `quarkustest`.
5. To run the GraphQL API, execute the [`run_graphql_api.sh`](run_graphql_api.sh) script. It will launch the quarkus in dev mode at port 5005, and GraphQL API will be available at [`http://localhost:8080/graphql`](http://localhost:8080/graphql).
6. To test the GraphQL endpoints, load the file [SimpleContactsGraphQL.postman_collection.json](documents/SimpleContactsGraphQL.postman_collection.json) in Postman and execute the API calls.
7. To run the GraphQL Client, execute the [`run_graphql_client.sh`](run_graphql_client.sh) script. It will launch the quarkus in dev mode at port 5006, and GraphQL API query results will be available at [`http://localhost:8081/dynamic`](http://localhost:8081/dynamic).
8. To test the subscription of GraphQL client, visit the URL [`http://localhost:8081/dynamic/subscription`](http://localhost:8081/dynamic/subscription), and try adding new contacts using Postman.