@graphiql/react
Advanced tools
Comparing version 0.7.1 to 0.8.0-canary-4f27e86f.0
{ | ||
"name": "@graphiql/react", | ||
"version": "0.7.1", | ||
"version": "0.8.0-canary-4f27e86f.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
import { StorageAPI } from '@graphiql/toolkit'; | ||
import { useCallback } from 'react'; | ||
import { useCallback, useMemo } from 'react'; | ||
@@ -160,6 +160,7 @@ import debounce from '../utility/debounce'; | ||
}) { | ||
const store = useCallback( | ||
debounce(500, (value: string) => { | ||
storage?.set(STORAGE_KEY, value); | ||
}), | ||
const store = useMemo( | ||
() => | ||
debounce(500, (value: string) => { | ||
storage?.set(STORAGE_KEY, value); | ||
}), | ||
[storage], | ||
@@ -166,0 +167,0 @@ ); |
@@ -1,2 +0,2 @@ | ||
import { DocumentNode, OperationDefinitionNode } from 'graphql'; | ||
import { DocumentNode, FragmentDefinitionNode, OperationDefinitionNode, ValidationRule } from 'graphql'; | ||
import { VariableToType } from 'graphql-language-service'; | ||
@@ -30,2 +30,5 @@ import { ReactNode } from 'react'; | ||
initialVariables: string; | ||
externalFragments: Map<string, FragmentDefinitionNode>; | ||
validationRules: ValidationRule[]; | ||
shouldPersistHeaders: boolean; | ||
}; | ||
@@ -36,2 +39,3 @@ export declare const EditorContext: import("react").Context<EditorContextType | null>; | ||
defaultQuery?: string; | ||
externalFragments?: string | FragmentDefinitionNode[]; | ||
headers?: string; | ||
@@ -41,2 +45,3 @@ onTabChange?(tabs: TabsState): void; | ||
shouldPersistHeaders?: boolean; | ||
validationRules?: ValidationRule[]; | ||
variables?: string; | ||
@@ -43,0 +48,0 @@ }; |
@@ -8,6 +8,5 @@ /// <reference types="react" /> | ||
readOnly?: boolean; | ||
shouldPersistHeaders?: boolean; | ||
keyMap?: KeyMap; | ||
}; | ||
export declare function useHeaderEditor({ editorTheme, keyMap, onEdit, readOnly, shouldPersistHeaders, }?: UseHeaderEditorArgs): import("react").RefObject<HTMLDivElement>; | ||
export declare function useHeaderEditor({ editorTheme, keyMap, onEdit, readOnly, }?: UseHeaderEditorArgs): import("react").RefObject<HTMLDivElement>; | ||
export declare const STORAGE_KEY = "headers"; |
/// <reference types="react" /> | ||
import type { SchemaReference } from 'codemirror-graphql/utils/SchemaReference'; | ||
import type { DocumentNode, FragmentDefinitionNode, ValidationRule } from 'graphql'; | ||
import type { DocumentNode } from 'graphql'; | ||
import { CopyQueryCallback, EditCallback } from './hooks'; | ||
@@ -9,3 +9,2 @@ import { KeyMap } from './types'; | ||
editorTheme?: string; | ||
externalFragments?: string | FragmentDefinitionNode[]; | ||
onClickReference?: OnClickReference; | ||
@@ -16,7 +15,6 @@ onCopyQuery?: CopyQueryCallback; | ||
readOnly?: boolean; | ||
validationRules?: ValidationRule[]; | ||
keyMap?: KeyMap; | ||
}; | ||
export declare function useQueryEditor({ editorTheme, keyMap, externalFragments, onClickReference, onCopyQuery, onEdit, onEditOperationName, readOnly, validationRules, }?: UseQueryEditorArgs): import("react").RefObject<HTMLDivElement>; | ||
export declare function useQueryEditor({ editorTheme, keyMap, onClickReference, onCopyQuery, onEdit, onEditOperationName, readOnly, }?: UseQueryEditorArgs): import("react").RefObject<HTMLDivElement>; | ||
export declare const STORAGE_KEY_QUERY = "query"; | ||
export {}; |
import { Fetcher, Unsubscribable } from '@graphiql/toolkit'; | ||
import { FragmentDefinitionNode } from 'graphql'; | ||
import { ReactNode } from 'react'; | ||
@@ -14,6 +13,4 @@ import { EditCallback } from './editor/hooks'; | ||
children: ReactNode; | ||
externalFragments?: FragmentDefinitionNode[] | string; | ||
fetcher: Fetcher; | ||
onEditOperationName?: EditCallback; | ||
shouldPersistHeaders?: boolean; | ||
}; | ||
@@ -20,0 +17,0 @@ export declare function ExecutionContextProvider(props: ExecutionContextProviderProps): JSX.Element; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1883933
41728