init
This commit is contained in:
28
main.jsx
Normal file
28
main.jsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { GraphiQL } from "graphiql";
|
||||
|
||||
import "graphiql/graphiql.css";
|
||||
|
||||
const fetcher = async (params) => {
|
||||
const res = await fetch(import.meta.env.VITE_GRAPHQL_ENDPOINT, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
});
|
||||
|
||||
return res.json();
|
||||
};
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<GraphiQL
|
||||
fetcher={fetcher}
|
||||
defaultEditorToolsVisibility={true}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")).render(<App />);
|
||||
Reference in New Issue
Block a user