From 83c9d6a92f16c5134ff6daad552628530081efa2 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Wed, 23 Feb 2022 14:44:58 +0000 Subject: [PATCH] Updated README.md --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2699406..c2bf770 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ module.exports = schema; ```js //there's a different handler object for query, create, update and delete -const queryHandler = { +const queryHandlers = { Author: (query, graph) => { //TODO: implement this }, @@ -104,7 +104,7 @@ const queryHandler = { }, }; -module.exports = queryHandler; +module.exports = queryHandlers; ``` Create a matching client-side function pointing to the server. @@ -112,18 +112,18 @@ Create a matching client-side function pointing to the server. ```js //create the wave function, wrapping a fetch to the server const wave = body => fetch('http://example.com/sineql', { - method: 'POST', - headers: { - 'Content-Type': 'text/plain' - }, - body: body + method: 'POST', + headers: { + 'Content-Type': 'text/plain' + }, + body: body }); //get a list of content wave('Author { name books { title } }') - .then(blob => blob.text()) - .then(text => console.log(text)) - .catch(e => console.error(e)) + .then(blob => blob.text()) + .then(text => console.log(text)) + .catch(e => console.error(e)) ; ```