docs/migration/graphiql-4.0.0.md
graphiql from 3.x to 4.0.0graphiqltitle attributedisableTabs optiononPrettifyQuery callback for custom formattingindex.umd.js[!WARNING]
⚠️
index.umd.jsis deprecated. Switch to the ESM CDN example.
-https://unpkg.com/graphiql/graphiql.js
-https://unpkg.com/graphiql/graphiql.min.js
+https://unpkg.com/graphiql/dist/index.umd.js // ⚠️ deprecated
-https://unpkg.com/graphiql/graphiql.css
-https://unpkg.com/graphiql/graphiql.min.css
+https://unpkg.com/graphiql/dist/style.css
-import GraphiQL from 'graphiql'
+import { GraphiQL } from 'graphiql'
-import 'graphiql/graphiql.css'
+import 'graphiql/style.css'
toolbar.additionalContent → <GraphiQL.Toolbar>Before:
<GraphiQL toolbar={{ additionalContent: <button>My button</button> }} />
After:
<GraphiQL>
<GraphiQL.Toolbar>
{({ merge, prettify, copy }) => (
<>
{prettify}
{merge}
{copy}
<button>My button</button>
</>
)}
</GraphiQL.Toolbar>
</GraphiQL>
toolbar.additionalComponent → <GraphiQL.Toolbar>Before:
<GraphiQL
toolbar={{
additionalComponent: function MyComponentWithAccessToContext() {
return <button>My button</button>;
},
}}
/>
After:
<GraphiQL>
<GraphiQL.Toolbar>
{({ merge, prettify, copy }) => (
<>
{prettify}
{merge}
{copy}
<MyComponentWithAccessToContext />
</>
)}
</GraphiQL.Toolbar>
</GraphiQL>
You can reorder or remove default toolbar buttons:
<GraphiQL>
<GraphiQL.Toolbar>
{({ prettify, copy }) => (
<>
{copy}
{prettify}
</>
)}
</GraphiQL.Toolbar>
</GraphiQL>
@graphiql/react@radix-ui and @headlessui/reactonPrettifyQuery callback for custom formatting-import '@graphiql/react/dist/style.css'
+import '@graphiql/react/style.css'
@graphiql/plugin-code-exporter-import '@graphiql/plugin-code-exporter/dist/style.css'
+import '@graphiql/plugin-code-exporter/style.css'
@graphiql/plugin-explorer-import '@graphiql/plugin-explorer/dist/style.css'
+import '@graphiql/plugin-explorer/style.css'