https://github.com/hardyscc/axon-graphql-starter
https://github.com/hardyscc/axon-graphql-starter
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hardyscc/axon-graphql-starter
- Owner: hardyscc
- Created: 2020-11-11T09:34:53.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-04-29T01:51:55.000Z (about 4 years ago)
- Last Synced: 2025-03-03T14:11:50.482Z (over 1 year ago)
- Language: Java
- Size: 94.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# axon-graphql-spl
## start supporting servers
```shell script
docker run -d --name some-axon-server -p 8024:8024 -p 8124:8124 axoniq/axonserver
docker run -d -e "MYSQL_ROOT_PASSWORD=Admin12345" -e "MYSQL_USER=usr" -e "MYSQL_PASSWORD=User12345" -e "MYSQL_DATABASE=development" -e "MYSQL_AUTHENTICATION_PLUGIN=mysql_native_password" -p 3306:3306 --name some-mysql bitnami/mysql:8.0.19
```
## stop supporting servers
```shell script
docker stop some-axon-server; docker rm some-axon-server
docker stop some-mysql; docker rm some-mysql
```
## Testing
### Command
```shell script
curl -X POST 'http://localhost:8080/hospital' -H 'Content-Type: application/json' \
-d '{ "hospCode": "VH" }'
curl -X POST 'http://localhost:8080/hospital/VH' -H 'Content-Type: application/json' \
-d '{ "wardCode": "A1" }'
curl -X POST 'http://localhost:8080/hospital/VH/ward/A1' -H 'Content-Type: application/json' \
-d '{ "bedNum": 12 }'
curl -X POST 'http://localhost:8080/patient' -H 'Content-Type: application/json' \
-d '{ "hkid": "A1234563", "name": "Mary" }'
curl -X POST 'http://localhost:8080/hospital/VH/ward/A1/checkIn' -H 'Content-Type: application/json' \
-d '{ "hkid": "A1234563", "bedNum": 12 }'
```
```Graph QL
subscription {
notification
}
mutation {
createHospital(input: { hospCode: "VH" })
}
mutation {
addWard(hospCode: "VH", input: { wardCode: "A1" }) {
wardCode
}
}
mutation {
addBed(hospCode: "VH", wardCode: "A1", input: { bedNum: 12 }) {
bedNum
}
}
mutation {
createPatient(input: { hkid: "A1234563", name: "Mary" })
}
mutation {
checkIn(
hospCode: "VH"
wardCode: "A1"
input: { hkid: "A1234563", bedNum: 12 }
) {
hkid
bedNum
}
}
```
### Query
```shell script
curl -X GET 'http://localhost:8080/hospital/VH'
```