Created
November 8, 2019 04:58
-
-
Save acao/f2d1739947436a71bc87911c7b1161ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from 'react'; | |
import { GraphQLSchema } from 'graphql'; | |
export interface GraphiQL extends Component<GraphiQLProps, GraphiQLState> {} | |
export interface GraphiQLProps { | |
fetcher?: (props: { query: string; operationName: string }) => Promise<any>; | |
schema?: GraphQLSchema; | |
query?: string; | |
variables?: string; | |
operationName?: string; | |
response?: string; | |
storage: { | |
getItem: (name: string) => any; | |
setItem: (name: string, item: any) => void; | |
removeItem: (name: string) => void; | |
}; | |
defaultQuery?: string; | |
defaultVariableEditorOpen?: boolean; | |
onCopyQuery?: Function; | |
onEditQuery?: Function; | |
onEditVariables?: Function; | |
onEditOperationName?: Function; | |
onToggleDocs?: Function; | |
getDefaultFieldNames?: Function; | |
editorTheme?: string; | |
onToggleHistory?: Function; | |
ResultsTooltip?: any; | |
readOnly?: boolean; | |
docExplorerOpen?: boolean; | |
} | |
export interface GraphiQLState { | |
schema?: GraphQLSchema; | |
response?: string; | |
query?: string; | |
} | |
export type RenderConfig = { | |
/** | |
* the url if no fetcher is provided | |
*/ | |
url: string; | |
/** | |
* the headers if no fetcher is provided | |
*/ | |
headers: Headers; | |
containerId?: string; | |
containerEl?: HTMLElement; | |
} & GraphiQLProps; | |
declare function renderGraphiQL(config?: RenderConfig): Promise<void>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment