This is a simple MQTT client simulator for connecting/disconnecting from HiveMQ broker.
- Use [npm install] to install dependencies
- Use [npm run dev] to run the application
Can be used to check if the application has successfully started.
Query
query{
healthcheck
}
Response
{
"data": {
"healthcheck": "App sucessfully running!"
}
}
Can be used for creating new client connection, if clientId is set to null. Can be used to cause # SESSION TAKEN OVER event by attemting to create new connection with existing clientId. Returns clientId.
Query
mutation($input: MqttClientInput!) {
connect(input: $input) {
clientId
}
}
Input
{
"input": {
"clientId": "string" # Optional parameter.
}
}
Can be used for ending an existing connection. Takes existing clientId as an input parameter. Returns connected (boolean). Returns false if the client was successfully disconnected.
Query
mutation {
endConnection(clientId: string) {
connected
}
}