|
|
@ -9,21 +9,19 @@ const client = createClient({
|
|
|
|
keepAlive: 10_000,
|
|
|
|
keepAlive: 10_000,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var resp = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log("STARTING_CLIENT")
|
|
|
|
console.log("STARTING_CLIENT")
|
|
|
|
client.subscribe({
|
|
|
|
client.subscribe({
|
|
|
|
query: "{ Arenas { Owner { ... on Match { Name } } } }",
|
|
|
|
query: "{ Arenas { Name Owner { ... on Match { Name, ID } } } }",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
next: (data) => {
|
|
|
|
next: (data) => {
|
|
|
|
console.log("NEXT")
|
|
|
|
console.log("NEXT")
|
|
|
|
console.log(data)
|
|
|
|
let r = JSON.parse(data.data)
|
|
|
|
resp = data.data
|
|
|
|
let game_id = r.Arenas[0].Owner.ID
|
|
|
|
|
|
|
|
console.log(game_id)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error: (err) => {
|
|
|
|
error: (err) => {
|
|
|
|
console.log("ERROR")
|
|
|
|
console.log("ERROR")
|
|
|
|
console.log(err)
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
complete: () => {
|
|
|
|
complete: () => {
|
|
|
|
console.log("COMPLETED")
|
|
|
|
console.log("COMPLETED")
|
|
|
@ -32,4 +30,4 @@ client.subscribe({
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<h1>{resp}</h1>
|
|
|
|
<h1></h1>
|
|
|
|