mutation proof of concept

client can now send mutations and server properly executes them
TODO: implement query execution, add auth, add storage
This commit is contained in:
2026-04-21 23:07:55 -05:00
parent c834c11bc8
commit 8092488b29
8 changed files with 112 additions and 26 deletions
+15 -2
View File
@@ -1,8 +1,21 @@
import { TetherClient } from "tether-ts";
import { createInterface } from "node:readline/promises";
const client = new TetherClient();
client.connect("ws://localhost:8080/tether");
client.subscribe("messages", (message) => {
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 });
}
}