- .Net core 5
- GraphQL.Client 3.2.4
- GraphQL.Client.Serializer.Newtonsoft 3.2.4
https://hasura.io/docs/latest/graphql/core/databases/postgres/subscriptions/index.html
See below the subscription as an example based on 2 tables vehicle and vehicle_location to get the lasted vehicle location
subscription getLocation($vehicleId: Int!) {
vehicle_location(where: {vehicle_id: {_eq: $vehicleId}}, order_by: {timestamp: desc}, limit: 1) {
id
location
timestamp
vehicle {
id
vehicle_number
}
}
}
- Run Hasura using the docker compose file
docker-compose up -d
-
Create the tables vehicle and vehicle_location
-
Run the C# console app
-
Add some data using the Hasura UI, should see the app is displaying the latest location.