Feature Plan - Ara Partner GraphQL API
To provide solutions for more rich process in the real-time data collection, Ara SaaS will provide a GraphQL API to allow a Partner to update a specific part of the realtime data model.
Allow a Partner to modify the data model
The user can add the GraphQL connector to a Partner. By default, the Partner won’t be able to modify the data model.
Via the dedicated setting, the user can open permissions on specific attributes:
graphql.mutable_attributes = "vehicle.occupancyStatus,vehicle.occupancyRate"
By using one of the tokens associated to this Partner, the specified attributs can be modified by mutation GraphQL requests.
Update the data model
By performing GraphQL requests with the required token, on the GraphQL endpoint of the associated referential (for example: https://ara.enroute.mobi/test/graphql), an external software can complete the Ara realtime data model.
For example, to update the current occupancyStatus
/ occupancyRate
of a Vehicle:
mutation {
updateVehicle(code: "24389", input: { occupancyStatus: "seatsAvailable", occupancyRate: 0.65 }) {
code
occupancyStatus
occupancyRate
}
}
mutation {
updateVehicle(code: "24389", input: { occupancyStatus: "seatsAvailable"}) {
code
}
}
mutation {
updateVehicle(code: "24389", input: { occupancyRate: 0.65 }) {
code
}
}
Multiple mutations can be performed into a single request by using the GraphQL multiple queries mechanism.
The model updates are taken into account instantly. The next requests will broadcast the new values.
Each GraphQL request is historized like other Ara API exchanges. The user can follow the Partner activity by this way.