Files
tether/example/client/index.ts
T
wisplite 8092488b29 mutation proof of concept
client can now send mutations and server properly executes them
TODO: implement query execution, add auth, add storage
2026-04-21 23:07:55 -05:00

21 lines
542 B
TypeScript

import { TetherClient } from "tether-ts";
import { createInterface } from "node:readline/promises";
const client = new TetherClient();
client.connect("ws://localhost:8080/tether");
client.subscribe("messages", { room: "1" }, (message) => {
console.log("Received message", message);
});
const rl = createInterface({
input: process.stdin,
output: process.stdout,
});
while (true) {
const message = await rl.question("Enter a message");
if (message) {
client.sendMutation("createMessage", { room: "1", message: message });
}
}