From 2fddc46d7792c2518d59bfe410148e55b121bc11 Mon Sep 17 00:00:00 2001 From: Mitch Chanza Date: Sat, 4 May 2024 18:20:26 +0200 Subject: [PATCH] update GraphqlPage.tsx --- src/components/Hello/GraphqlPage.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/Hello/GraphqlPage.tsx b/src/components/Hello/GraphqlPage.tsx index ebbf3a1..fad600d 100644 --- a/src/components/Hello/GraphqlPage.tsx +++ b/src/components/Hello/GraphqlPage.tsx @@ -1,8 +1,21 @@ import React from 'react' +import { env } from 'process' export default async function GraphqlPage() { + const data = await fetch(`${env.AUTH_URL}/api/graphql`, + { + method: "POST", + body: JSON.stringify({ + query: `query Query($name: String="graphql") { hello(name: $name) } + `, + }), + headers: { + "Content-Type": "application/json", + }, + } + ).then((res) => res.json()); return ( -
- Graphql Server + data &&
+ {data.data.hello}
) }