Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GraphQLStore

Hierarchy

  • GraphQLStore

Index

Constructors

constructor

Properties

Private _listeners

_listeners: StoreListener[] = []

client

Private store

store: Store

Methods

dispatch

  • dispatch(requestSignature: string, state: StoreState, schemaKey?: undefined | string): void

getItem

  • getItem(requestSignature: string): undefined | object

getListeners

  • getListeners(): function[]

getState

  • getState(): object

middleware

  • middleware(ctx: object): Promise<object>
  • Parameters

    • ctx: object
      • action: Actions
      • config: FetcherConfig<V, R>
      • Optional errors?: string[]
      • Optional querySuffix?: undefined | string
      • requestConfig: RequestInit
      • Optional result?: R | null
      • variables: V

    Returns Promise<object>

mountRequestSignature

  • mountRequestSignature(schemaKey: string, variables: Dict): string
  • mounts a string with schemaKey and variables like 'postCount(foo:12,bar:1)'

    Parameters

    • schemaKey: string
    • variables: Dict

    Returns string

optimisticUpdate

  • optimisticUpdate(methodName: string, variables: Dict, setter: function): void

setItem

  • setItem(requestSignature: string, state: StoreState, schemaKey: string, shouldDispatch?: boolean): void
  • Parameters

    • requestSignature: string
    • state: StoreState
    • schemaKey: string
    • Default value shouldDispatch: boolean = true

    Returns void

subscribe

Generated using TypeDoc