File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/graphiql-react/src/editor Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -366,14 +366,20 @@ export function EditorContextProvider(props: EditorContextProviderProps) {
366
366
headerEditor,
367
367
responseEditor,
368
368
} ) ;
369
- const { onTabChange, defaultHeaders, children } = props ;
369
+ const { onTabChange, defaultHeaders, defaultQuery , children } = props ;
370
370
371
371
const addTab = useCallback < EditorContextType [ 'addTab' ] > ( ( ) => {
372
372
setTabState ( current => {
373
373
// Make sure the current tab stores the latest values
374
374
const updatedValues = synchronizeActiveTabValues ( current ) ;
375
375
const updated = {
376
- tabs : [ ...updatedValues . tabs , createTab ( { headers : defaultHeaders } ) ] ,
376
+ tabs : [
377
+ ...updatedValues . tabs ,
378
+ createTab ( {
379
+ headers : defaultHeaders ,
380
+ query : defaultQuery ?? DEFAULT_QUERY ,
381
+ } ) ,
382
+ ] ,
377
383
activeTabIndex : updatedValues . tabs . length ,
378
384
} ;
379
385
storeTabs ( updated ) ;
You can’t perform that action at this time.
0 commit comments