Options
All
  • Public
  • Public/Protected
  • All
Menu

Package graphiql-plugin-history

@graphiql/plugin-history

API

  • useHistory: Persists executed requests in storage
  • useHistoryActions: Actions related to the history

Index

References

CancellationToken

Re-exports CancellationToken

CancellationTokenSource

Re-exports CancellationTokenSource

Emitter

Re-exports Emitter

Environment

Re-exports Environment

HistoryStore

Re-exports HistoryStore

IDisposable

Re-exports IDisposable

IEvent

Re-exports IEvent

IKeyboardEvent

Re-exports IKeyboardEvent

IMarkdownString

Re-exports IMarkdownString

IMouseEvent

Re-exports IMouseEvent

IPosition

Re-exports IPosition

IRange

Re-exports IRange

IScrollEvent

Re-exports IScrollEvent

ISelection

Re-exports ISelection

ITrustedTypePolicy

Re-exports ITrustedTypePolicy

ITrustedTypePolicyOptions

Re-exports ITrustedTypePolicyOptions

KeyCode

Re-exports KeyCode

KeyMod

Re-exports KeyMod

MarkdownStringTrustedOptions

Re-exports MarkdownStringTrustedOptions

MarkerSeverity

Re-exports MarkerSeverity

MarkerTag

Re-exports MarkerTag

Position

Re-exports Position

Range

Re-exports Range

Selection

Re-exports Selection

SelectionDirection

Re-exports SelectionDirection

Thenable

Re-exports Thenable

Token

Re-exports Token

Uri

Re-exports Uri

UriComponents

Re-exports UriComponents

Window

Re-exports Window

editor

Re-exports editor

languages

Re-exports languages

useHistory

Re-exports useHistory

useHistoryActions

Re-exports useHistoryActions

useHistoryContext

Re-exports useHistoryContext

worker

Re-exports worker

Variables

Const create

create: Create = (<T>(stateCreator: StateCreator<T>) => {console.log('zustand create mock');// to support a curried version of createreturn typeof stateCreator === 'function'? createUncurried(stateCreator): createUncurried;}) as typeof originalCreate

Const createStore

createStore: CreateStore = (<T>(stateCreator: StateCreator<T>) => {console.log('zustand createStore mock');// to support a curried version of createStorereturn typeof stateCreator === 'function'? createStoreUncurried(stateCreator): createStoreUncurried;}) as typeof originalCreateStore

Const storeResetFns

storeResetFns: Set<() => void> = new Set<() => void>()

Functions

Const History

  • History(): Element

Const HistoryItem

  • HistoryItem(props: QueryHistoryItemProps): Element

Const HistoryStore

  • HistoryStore(__namedParameters: { children: ReactNode; maxHistoryLength: number }): ReactElement<unknown, string | ((props: P) => ReactElement<any, any> | null) | {}>
  • The functions send the entire operation so users can customize their own application and get access to the operation plus any additional props they added for their needs (i.e., build their own functions that may save to a backend instead of localStorage and might need an id property added to the QueryStoreItem)

    Parameters

    • __namedParameters: { children: ReactNode; maxHistoryLength: number }
      • children: ReactNode
      • maxHistoryLength: number

    Returns ReactElement<unknown, string | ((props: P) => ReactElement<any, any> | null) | {}>

formatQuery

Const useHistory

Const useHistoryActions

  • useHistoryActions(): { addToHistory: any; deleteFromHistory: any; editLabel: any; setActive: any; toggleFavorite: any }
  • Actions are functions used to update values in your store. They are static and never change.

    see

    https://tkdodo.eu/blog/working-with-zustand#separate-actions-from-state

    Returns { addToHistory: any; deleteFromHistory: any; editLabel: any; setActive: any; toggleFavorite: any }

    • addToHistory: function
      • addToHistory(operation: { headers?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }): void
      • Add an operation to the history.

        Parameters

        • operation: { headers?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }

          The operation that was executed, consisting of the query, variables, headers, and operation name.

          • Optional headers?: undefined | string
          • Optional operationName?: undefined | string
          • Optional query?: undefined | string
          • Optional variables?: undefined | string

        Returns void

    • deleteFromHistory: function
      • deleteFromHistory(args: QueryStoreItem, clearFavorites?: undefined | false | true): void
      • Delete an operation from the history.

        Parameters

        • args: QueryStoreItem

          The operation that was executed, consisting of the query, variables, headers, and operation name.

        • Optional clearFavorites: undefined | false | true

          This is only if you press the 'clear' button

        Returns void

    • editLabel: function
      • editLabel(args: { favorite?: undefined | false | true; headers?: undefined | string; label?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }, index?: undefined | number): void
      • Change the custom label of an item from the history.

        Parameters

        • args: { favorite?: undefined | false | true; headers?: undefined | string; label?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }

          An object containing the label (undefined if it should be unset) and properties that identify the history item that the label should be applied to. (This can result in the label being applied to multiple history items.)

          • Optional favorite?: undefined | false | true
          • Optional headers?: undefined | string
          • Optional label?: undefined | string
          • Optional operationName?: undefined | string
          • Optional query?: undefined | string
          • Optional variables?: undefined | string
        • Optional index: undefined | number

          Index to edit. Without it, will look for the first index matching the operation, which may lead to misleading results if multiple items have the same label

        Returns void

    • setActive: function
    • toggleFavorite: function
      • toggleFavorite(args: { favorite?: undefined | false | true; headers?: undefined | string; label?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }): void
      • Toggle the favorite state of an item from the history.

        Parameters

        • args: { favorite?: undefined | false | true; headers?: undefined | string; label?: undefined | string; operationName?: undefined | string; query?: undefined | string; variables?: undefined | string }

          An object containing the favorite state (undefined if it should be unset) and properties that identify the history item that the label should be applied to. (This can result in the label being applied to multiple history items.)

          • Optional favorite?: undefined | false | true
          • Optional headers?: undefined | string
          • Optional label?: undefined | string
          • Optional operationName?: undefined | string
          • Optional query?: undefined | string
          • Optional variables?: undefined | string

        Returns void

useHistoryContext

Object literals

Const HISTORY_PLUGIN

HISTORY_PLUGIN: object

content

content: FC<{}> = History

icon

icon: FC<SVGProps<SVGSVGElement>> = HistoryIcon

title

title: string = "History"

Generated using TypeDoc