mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 12:25:05 +03:00
* Bump all versions of postcss to 8.5.3. * Run next/codemod on the docs app. * Move two experimental flags into stable. Add next-mdx-remote as a transpiled package. * Add extra folders to the clean command in docs. * Fix type errors in docs test. * Run prettier on the new files. * remove turbopack, fix fetch revalidation, fix metadata awaits Couple of minor fixes: - Turbopack doesn't work in dev because of known MDX loader limitations (cannot load functions in MDX plugin config) - Fetches not cached by default anymore in Next 15 so need to manually cache the ones we need - Missing a few awaits for metadata generation with page params * Bump the graphiql version because headlessui/react is not building with Next 15. --------- Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
34 lines
937 B
TypeScript
34 lines
937 B
TypeScript
'use client'
|
|
|
|
import dynamic from 'next/dynamic'
|
|
import { notFound } from 'next/navigation'
|
|
import { type ComponentProps } from 'react'
|
|
import { IS_DEV } from '~/lib/constants'
|
|
|
|
const LazyGraphiQL = dynamic(
|
|
async () => {
|
|
const { GraphiQL: GraphiQLPrimitive } = await import('graphiql')
|
|
const { createGraphiQLFetcher } = await import('@graphiql/toolkit')
|
|
await import('graphiql/style.css')
|
|
|
|
return function GraphiQL(props: Omit<ComponentProps<typeof GraphiQLPrimitive>, 'fetcher'>) {
|
|
const fetcher = createGraphiQLFetcher({
|
|
url: 'http://localhost:3001/docs/api/graphql',
|
|
})
|
|
return <GraphiQLPrimitive fetcher={fetcher} {...props} />
|
|
}
|
|
},
|
|
{
|
|
loading: () => <div className="p-6">Loading GraphiQL...</div>,
|
|
ssr: false,
|
|
}
|
|
)
|
|
|
|
export default function GraphiQLPage() {
|
|
if (!IS_DEV) {
|
|
notFound()
|
|
}
|
|
|
|
return <LazyGraphiQL className="!h-[calc(100vh-var(--header-height))]" />
|
|
}
|