GraphiQL API Documentation
    Preparing search index...

    Type Alias Storage

    This describes the attributes and methods that a store has to support in order to be used with GraphiQL. It closely resembles the localStorage API as it is the default storage used in GraphiQL.

    type Storage = {
        length: number;
        clear(): void;
        getItem(key: string): string | null;
        removeItem(key: string): void;
        setItem(key: string, value: string): void;
    }
    Index

    Properties

    length: number

    The number of items that are currently stored.

    Methods

    • Retrieve an item from the store by its key.

      Parameters

      • key: string

        The key of the item to retrieve.

      Returns string | null

      The stored value for the given key if it exists, null otherwise.

    • Remove the value for a given key from the store. If there is no value for the given key this method does nothing.

      Parameters

      • key: string

        The key to remove the value from the store.

      Returns void

    • Add a value to the store for a given key. If there already exists a value for the given key, this method will override the value.

      Parameters

      • key: string

        The key to store the value for.

      • value: string

        The value to store.

      Returns void