From 7f4c5dc20f87063ba61be58347f2919c80f9052d Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 4 Mar 2024 20:05:20 +0300 Subject: [PATCH] get-shout-data-fix --- index.mjs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.mjs b/index.mjs index 6e4bea5..9291924 100644 --- a/index.mjs +++ b/index.mjs @@ -72,18 +72,17 @@ const server = Server.configure({ headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ query: `query { - get_shout(shout_id: $shout_id) { + get_shout(shout_id: ${shout_id}) { id slug authors } } - `, - variables: { shout_id }, + ` }), }) .then(res => res.json()) - .then((data) => { + .then(({ data }) => { console.debug('shout data:', data) const { authors } = data.get_shout; if (authors.includes(author_id)) {