Second frontend, written in Next.JS + Typescript.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
771 B

{"ast":null,"code":"import config from \"../../config\";\nimport fetch from \"node-fetch\";\n\nclass GQLSSRClient {\n async post(query, variables, operationName) {\n const res = await fetch(config.apiUrl(\"/graphql\"), {\n method: \"POST\",\n body: JSON.stringify({\n query,\n variables,\n operationName\n }),\n credentials: \"include\",\n headers: {\n \"Content-Type\": \"application/json\"\n }\n });\n const json = await res.json();\n\n if (json.errors) {\n throw new Error(`${json.errors[0].message} (${json.errors[0].path})`);\n }\n\n return json.data;\n }\n\n}\n\nconst gqlSsrClient = new GQLSSRClient();\nexport default gqlSsrClient;","map":null,"metadata":{},"sourceType":"module"}