diff --git a/.changeset/curvy-balloons-allow.md b/.changeset/curvy-balloons-allow.md
new file mode 100644
index 00000000000..3a095e0a948
--- /dev/null
+++ b/.changeset/curvy-balloons-allow.md
@@ -0,0 +1,5 @@
+---
+'graphiql': minor
+---
+
+Allow disabling tabs and added new prop `disableTabs`
diff --git a/packages/graphiql/src/components/GraphiQL.tsx b/packages/graphiql/src/components/GraphiQL.tsx
index 286c4a67962..fb2a44522ff 100644
--- a/packages/graphiql/src/components/GraphiQL.tsx
+++ b/packages/graphiql/src/components/GraphiQL.tsx
@@ -167,6 +167,7 @@ export function GraphiQL({
>
@@ -214,6 +215,7 @@ export type GraphiQLInterfaceProps = WriteableEditorProps &
* settings modal.
*/
showPersistHeadersSettings?: boolean;
+ disableTabs?: boolean;
};
export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
@@ -518,43 +520,45 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
)}
-
- {editorContext.tabs.length > 1 && (
- <>
- {editorContext.tabs.map((tab, index) => (
-
- {
- executionContext.stop();
- editorContext.changeTab(index);
- }}
+ {props.disableTabs ? null : (
+
+ {editorContext.tabs.length > 1 && (
+ <>
+ {editorContext.tabs.map((tab, index) => (
+
- {tab.title}
-
- {
- if (editorContext.activeTabIndex === index) {
+ {
executionContext.stop();
- }
- editorContext.closeTab(index);
- }}
- />
-
- ))}
- {addTab}
- >
- )}
-
+ editorContext.changeTab(index);
+ }}
+ >
+ {tab.title}
+
+
{
+ if (editorContext.activeTabIndex === index) {
+ executionContext.stop();
+ }
+ editorContext.closeTab(index);
+ }}
+ />
+
+ ))}
+ {addTab}
+ >
+ )}
+
+ )}
{editorContext.tabs.length === 1 && addTab}
{logo}