Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SlicesWithActions

Hierarchy

Index

Properties

actions

actions: AllActions

activeTabIndex

activeTabIndex: number

The index of the currently active tab with regards to the tabs list of this object.

Optional defaultHeaders

defaultHeaders: undefined | string

Headers to be set when opening a new tab.

Optional defaultQuery

defaultQuery: undefined | string

The initial content of the operation editor when loading GraphiQL and there is no saved query in storage and no initialQuery prop.

This value is used only for the first tab. Additional tabs will open with an empty operation editor.

default

"# Welcome to GraphiQL..."

Optional documentAST

documentAST: OperationFacts["documentAST"]
remarks

from graphiql 5

externalFragments

externalFragments: Map<string, FragmentDefinitionNode>

A map of fragment definitions using the fragment name as a key which are made available to include in the query.

fetchError

fetchError: string | null

Stores an error raised during introspecting or building the GraphQL schema from the introspection result.

fetcher

fetcher: Fetcher

A function which accepts GraphQL HTTP parameters and returns a Promise, Observable or AsyncIterable that returns the GraphQL response in parsed JSON format.

We suggest using the createGraphiQLFetcher utility from @graphiql/toolkit to create these fetcher functions.

see

createGraphiQLFetcher

Optional getDefaultFieldNames

getDefaultFieldNames: GetDefaultFieldNamesFn

A function to determine which field leafs are automatically added when trying to execute a query with missing selection sets. It will be called with the GraphQLType for which fields need to be added.

Optional headerEditor

headerEditor: MonacoEditor

The Monaco Editor instance used in the request headers editor, used to edit HTTP headers.

initialHeaders

initialHeaders: string

The contents of the request headers editor when initially rendering the provider component.

initialQuery

initialQuery: string

The contents of the operation editor when initially rendering the provider component.

initialVariables

initialVariables: string

The contents of the variables editor when initially rendering the provider component.

isFetching

isFetching: boolean

If there is currently a GraphQL request in-flight. For multipart requests like subscriptions, this will be true while fetching the first partial response and false while fetching subsequent batches.

default

false

isIntrospecting

isIntrospecting: boolean

If there currently is an introspection request in-flight.

Optional monacoTheme

monacoTheme: MonacoTheme

Optional onCopyQuery

onCopyQuery: undefined | ((query: string) => void)

Invoked when the current contents of the operation editor are copied to the clipboard.

param

The content that has been copied.

onPrettifyQuery

onPrettifyQuery: (query: string) => MaybePromise<string>

Invoked when the prettify callback is invoked.

param

The current value of the operation editor.

default

import prettier from 'prettier/standalone'

prettier.format(query, { parser: 'graphql' })

returns

The formatted query.

Type declaration

Optional operationName

operationName: undefined | string
remarks

from graphiql 5

Optional operations

operations: OperationFacts["operations"]
remarks

from graphiql 5

overrideOperationName

overrideOperationName: string | null

The operation name that will be sent with all GraphQL requests.

default

null

plugins

plugins: GraphiQLPlugin[]

A list of all current plugins, including the built-in ones (the doc explorer and the history).

default

[]

Optional queryEditor

queryEditor: MonacoEditor

The Monaco Editor instance used in the operation editor.

queryId

queryId: number
default

0

Optional referencePlugin

referencePlugin: GraphiQLPlugin | null

The plugin which is used to display the reference documentation when selecting a type. Pass null to remove plugin.

requestCounter

requestCounter: number

A counter that is incremented each time introspection is triggered or the schema state is updated.

Optional responseEditor

responseEditor: MonacoEditor

The Monaco Editor instance used in the response editor.

schema

schema: MaybeGraphQLSchema

The current GraphQL schema.

schemaReference

schemaReference: SchemaReference | null

The last type selected by the user.

shouldIntrospect

shouldIntrospect: boolean

false when schema is provided via props as GraphQLSchema | null

shouldPersistHeaders

shouldPersistHeaders: boolean

If the contents of the request headers editor are persisted in storage.

storage

storage: StorageAPI

subscription

subscription: Unsubscribable | null

Represents an active GraphQL subscription.

For multipart operations such as subscriptions, this will hold an Unsubscribable object while the request is in-flight. It remains non-null until the operation completes or is manually unsubscribed.

remarks

Use subscription?.unsubscribe() to cancel the request.

default

null

tabs

tabs: TabState[]

A list of state objects for each tab.

theme

theme: Theme

uriInstanceId

uriInstanceId: string

Unique ID of the GraphiQL instance, which will be suffixed to the URIs for operations, variables, headers, and response editors.

see

https://github.com/microsoft/monaco-editor#uris

validationErrors

validationErrors: readonly GraphQLError[]

A list of errors from validating the current GraphQL schema. The schema is valid if and only if this list is empty.

Optional variableEditor

variableEditor: MonacoEditor

The Monaco Editor instance used in the variables editor.

visiblePlugin

visiblePlugin: GraphiQLPlugin | null

The plugin which is currently visible.

Methods

Optional onEditOperationName

  • onEditOperationName(operationName: string): void
  • Invoked when the operation name changes. Possible triggers are:

    • Editing the contents of the operation editor
    • Selecting an operation for execution in a document that contains multiple operation definitions

    Parameters

    • operationName: string

      The operation name after it has been changed.

    Returns void

Optional onTabChange

Optional onTogglePluginVisibility

  • onTogglePluginVisibility(visiblePlugin: GraphiQLPlugin | null): void

Generated using TypeDoc