Add docs CI and fix docs build (#176)

* Add docs CI and fix docs build

* Fix CI name
This commit is contained in:
Félix Malfait
2023-06-01 16:21:31 +02:00
committed by GitHub
parent 58bbadcc30
commit 05c8fac6d6
4 changed files with 41 additions and 5 deletions

View File

@ -3,16 +3,24 @@ import { GraphiQL } from 'graphiql';
import React from 'react';
import ReactDOM from 'react-dom';
import Layout from '@theme/Layout';
import BrowserOnly from '@docusaurus/BrowserOnly';
import 'graphiql/graphiql.css';
const fetcher = createGraphiQLFetcher({ url: 'https://api.twenty.com/graphql' });
// Docusaurus does SSR for custom pages but we need to load GraphiQL in the browser
function GraphiQLComponent() {
const fetcher = createGraphiQLFetcher({ url: 'https://api.twenty.com/graphql' });
return <GraphiQL fetcher={fetcher} />;
}
export default function graphQL() {
return (
<Layout title="Hello" description="Hello React Page">
<div class="fullHeightPlayground">
<GraphiQL fetcher={fetcher} />
<div className="fullHeightPlayground">
<BrowserOnly>
<GraphiQLComponent />
</BrowserOnly>
</div>
</Layout>
);