import "reflect-metadata"
import "./index.scss"
import { createRoot } from "react-dom/client"
import { GraphiQL } from "graphiql"
import { graphql } from "~/shared/messaging"

const App = () => (
  <GraphiQL
    fetcher={async arg => {
      const result = await graphql(arg.query as any, arg.variables)
      return result as any
    }}
  />
)

const root = createRoot(document.getElementById("root")!)
requestAnimationFrame(() => {
  root.render(<App />)
})
