From ea8fd1255d9c4c219c6dfea3a22ad67e5332d0fc Mon Sep 17 00:00:00 2001 From: chentsulin Date: Sat, 27 Nov 2021 23:23:07 +0800 Subject: [PATCH] feat: support shouldPersistHeaders --- src/renderGraphiQL.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/renderGraphiQL.ts b/src/renderGraphiQL.ts index a62edd4..9730ec8 100644 --- a/src/renderGraphiQL.ts +++ b/src/renderGraphiQL.ts @@ -21,6 +21,13 @@ export interface GraphiQLOptions { */ headerEditorEnabled?: boolean; + /** + * An optional boolean which enables headers to be saved to local + * storage when true. + * Defaults to false. + */ + shouldPersistHeaders?: boolean; + /** * By passing an object you may change the theme of GraphiQL. */ @@ -105,6 +112,7 @@ export function renderGraphiQL( const operationName = data.operationName; const defaultQuery = options?.defaultQuery; const headerEditorEnabled = options?.headerEditorEnabled; + const shouldPersistHeaders = options?.shouldPersistHeaders; const editorTheme = getEditorThemeParams(options?.editorTheme); return `