();
useEffect(() => {
import("graphiql").then(imported => {
setGraphiQL(() => imported.default);
});
}, []);
if (typeof window === "undefined") {
return javascript required
;
} else {
if (!GraphiQL) {
return loading
;
} else {
return (
fetch(GRAPHQL_ENDPOINT, {
body: JSON.stringify(query),
headers: { "Content-Type": "application/json" },
method: "post",
}).then(response => response.json())
}
/>
);
}
}
};
export default GraphiQLPage;