Serve job metric data via GraphQL

This commit is contained in:
Lou Knauer
2021-04-07 09:19:21 +02:00
parent 4273878e9b
commit a52445086b
6 changed files with 2164 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
# Run server
* The server expects the SQLite Job database in `job.db`.
* The metric data as JSON is expected in `job-data/.../.../{data.json|meta.json}`
* Run ```go run server.go```
* The GraphQL backend is located at http://localhost:8080/query/ .
@@ -34,7 +35,7 @@ Using the Query variables:
"filter": { "list": [
{"userId": {"contains": "unrz"}},
{"duration": {"from": 60, "to": 1000}},
{"startTime": {"from": "2019-06-01T00:00:00.00Z", "to": "2019-10-01T00:00:00.00Z"}}]},
{"startTime": {"from": "2019-06-01T00:00:00.00Z", "to": "2019-10-01T00:00:00.00Z"}}]},
"sorting": { "field": "start_time", "order": "ASC" },
"paging": { "itemsPerPage": 20, "page": 1 }
}
@@ -44,4 +45,4 @@ Using the Query variables:
* Edit ```./graph/schema.graphqls```
* Regenerate code: ```gqlgen generate```
* Implement callbacks in ```graph/schema.resolvers.go```
* Implement callbacks in ```graph/resolvers.go```