@@ -167,6 +167,7 @@ export function GraphiQL({
167
167
>
168
168
< GraphiQLInterface
169
169
showPersistHeadersSettings = { shouldPersistHeaders !== false }
170
+ disableTabs = { props . disableTabs ?? false }
170
171
{ ...props }
171
172
/>
172
173
</ GraphiQLProvider >
@@ -214,6 +215,7 @@ export type GraphiQLInterfaceProps = WriteableEditorProps &
214
215
* settings modal.
215
216
*/
216
217
showPersistHeadersSettings ?: boolean ;
218
+ disableTabs ?: boolean ;
217
219
} ;
218
220
219
221
export function GraphiQLInterface ( props : GraphiQLInterfaceProps ) {
@@ -518,43 +520,45 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) {
518
520
) }
519
521
< div ref = { pluginResize . secondRef } className = "graphiql-sessions" >
520
522
< div className = "graphiql-session-header" >
521
- < Tabs
522
- values = { editorContext . tabs }
523
- onReorder = { handleReorder }
524
- aria-label = "Select active operation"
525
- >
526
- { editorContext . tabs . length > 1 && (
527
- < >
528
- { editorContext . tabs . map ( ( tab , index ) => (
529
- < Tab
530
- key = { tab . id }
531
- value = { tab }
532
- isActive = { index === editorContext . activeTabIndex }
533
- >
534
- < Tab . Button
535
- aria-controls = "graphiql-session"
536
- id = { `graphiql-session-tab-${ index } ` }
537
- onClick = { ( ) => {
538
- executionContext . stop ( ) ;
539
- editorContext . changeTab ( index ) ;
540
- } }
523
+ { props . disableTabs ? null : (
524
+ < Tabs
525
+ values = { editorContext . tabs }
526
+ onReorder = { handleReorder }
527
+ aria-label = "Select active operation"
528
+ >
529
+ { editorContext . tabs . length > 1 && (
530
+ < >
531
+ { editorContext . tabs . map ( ( tab , index ) => (
532
+ < Tab
533
+ key = { tab . id }
534
+ value = { tab }
535
+ isActive = { index === editorContext . activeTabIndex }
541
536
>
542
- { tab . title }
543
- </ Tab . Button >
544
- < Tab . Close
545
- onClick = { ( ) => {
546
- if ( editorContext . activeTabIndex === index ) {
537
+ < Tab . Button
538
+ aria-controls = "graphiql-session"
539
+ id = { `graphiql-session-tab-${ index } ` }
540
+ onClick = { ( ) => {
547
541
executionContext . stop ( ) ;
548
- }
549
- editorContext . closeTab ( index ) ;
550
- } }
551
- />
552
- </ Tab >
553
- ) ) }
554
- { addTab }
555
- </ >
556
- ) }
557
- </ Tabs >
542
+ editorContext . changeTab ( index ) ;
543
+ } }
544
+ >
545
+ { tab . title }
546
+ </ Tab . Button >
547
+ < Tab . Close
548
+ onClick = { ( ) => {
549
+ if ( editorContext . activeTabIndex === index ) {
550
+ executionContext . stop ( ) ;
551
+ }
552
+ editorContext . closeTab ( index ) ;
553
+ } }
554
+ />
555
+ </ Tab >
556
+ ) ) }
557
+ { addTab }
558
+ </ >
559
+ ) }
560
+ </ Tabs >
561
+ ) }
558
562
< div className = "graphiql-session-header-right" >
559
563
{ editorContext . tabs . length === 1 && addTab }
560
564
{ logo }
0 commit comments