Prometheus Entity Management API
    Preparing search index...
    Index
    • Type Parameters

      • TData
      • TEntity extends object

      Parameters

      • opts: {
            descriptors?: EntityDescriptor<unknown, TEntity>[];
            document: string;
            optimistic?: () => void;
            store?: Omit<
                Omit<StoreApi<GraphState>, "subscribe"> & {
                    subscribe: {
                        (
                            listener: (
                                selectedState: GraphState,
                                previousSelectedState: GraphState,
                            ) => void,
                        ): () => void;
                        <U>(
                            selector: (state: GraphState) => U,
                            listener: (selectedState: U, previousSelectedState: U) => void,
                            options?: {
                                equalityFn?: (a: ..., b: ...) => ...;
                                fireImmediately?: boolean;
                            },
                        ): () => void;
                    };
                },
                "setState",
            > & {
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | Partial<GraphState>
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace?: false,
                ): void;
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace: true,
                ): void;
            };
            variables?: Record<string, unknown>;
        }

      Returns Promise<GQLResponse<TData>>

    • Type Parameters

      • TData
      • TEntity extends object

      Parameters

      • opts: {
            cacheKey?: string;
            descriptors: EntityDescriptor<unknown, TEntity>[];
            document: string;
            listIngestion?: GQLListIngestion<TData, TEntity>;
            store?: Omit<
                Omit<StoreApi<GraphState>, "subscribe"> & {
                    subscribe: {
                        (
                            listener: (
                                selectedState: GraphState,
                                previousSelectedState: GraphState,
                            ) => void,
                        ): () => void;
                        <U>(
                            selector: (state: GraphState) => U,
                            listener: (selectedState: U, previousSelectedState: U) => void,
                            options?: {
                                equalityFn?: (a: ..., b: ...) => ...;
                                fireImmediately?: boolean;
                            },
                        ): () => void;
                    };
                },
                "setState",
            > & {
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | Partial<GraphState>
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace?: false,
                ): void;
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace: true,
                ): void;
            };
            variables?: Record<string, unknown>;
        }

      Returns Promise<GQLResponse<TData>>

    • Type Parameters

      • TData

      Parameters

      • opts: {
            descriptors: EntityDescriptor<unknown, Record<string, unknown>>[];
            document: string;
            onData?: (data: TData) => void;
            onError?: (e: unknown) => void;
            store?: Omit<
                Omit<StoreApi<GraphState>, "subscribe"> & {
                    subscribe: {
                        (
                            listener: (
                                selectedState: GraphState,
                                previousSelectedState: GraphState,
                            ) => void,
                        ): () => void;
                        <U>(
                            selector: (state: GraphState) => U,
                            listener: (selectedState: U, previousSelectedState: U) => void,
                            options?: {
                                equalityFn?: (a: ..., b: ...) => ...;
                                fireImmediately?: boolean;
                            },
                        ): () => void;
                    };
                },
                "setState",
            > & {
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | Partial<GraphState>
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace?: false,
                ): void;
                setState(
                    nextStateOrUpdater:
                        | GraphState
                        | (
                            (
                                state: {
                                    appendListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    clearEntitySyncMetadata: (type: string, id: string) => void;
                                    clearPatch: (type: string, id: string) => void;
                                    entities: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    entityStates: {
                                        [x: string]: {
                                            error: string | null;
                                            isFetching: boolean;
                                            lastFetched: number | null;
                                            stale: boolean;
                                        };
                                    };
                                    ingestFetchedList: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                        options?: IngestFetchedListOptions,
                                    ) => void;
                                    insertIdInList: (
                                        key: string,
                                        id: string,
                                        position: number | "end" | "start",
                                    ) => void;
                                    invalidateEntity: (type: string, id?: string) => void;
                                    invalidateLists: (
                                        matcher: string | ((key: string) => boolean),
                                    ) => void;
                                    invalidateType: (type: string) => void;
                                    lists: {
                                        [x: string]: {
                                            currentPage: number | null;
                                            error: string | null;
                                            hasNextPage: boolean;
                                            hasPrevPage: boolean;
                                            ids: string[];
                                            isFetching: boolean;
                                            isFetchingMore: boolean;
                                            lastError:
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | {
                                                    cause?: ...;
                                                    kind: ...;
                                                    message: ...;
                                                    name: ...;
                                                    stack?: ...;
                                                    status?: ...;
                                                }
                                                | null;
                                            lastFetched: number
                                            | null;
                                            nextCursor: string | null;
                                            pageSize: number | null;
                                            prevCursor: string | null;
                                            stale: boolean;
                                            total: number | null;
                                        };
                                    };
                                    patchEntity: (
                                        type: string,
                                        id: string,
                                        patch: Record<string, unknown>,
                                    ) => void;
                                    patches: { [x: string]: { [x: string]: { [x: string]: unknown } } };
                                    prependListResult: (
                                        key: string,
                                        ids: string[],
                                        meta?: Partial<ListState>,
                                    ) => void;
                                    readEntity: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => T | null;
                                    readEntitySnapshot: <T = Record<string, unknown>>(
                                        type: string,
                                        id: string,
                                    ) => EntitySnapshot<(...) & (...)> | null;
                                    removeEntity: (type: string, id: string) => void;
                                    removeIdFromAllLists: (type: string, id: string) => void;
                                    replaceEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                    setEntityError: (
                                        type: string,
                                        id: string,
                                        error: string | null,
                                    ) => void;
                                    setEntityFetched: (type: string, id: string) => void;
                                    setEntityFetching: (
                                        type: string,
                                        id: string,
                                        fetching: boolean,
                                    ) => void;
                                    setEntityStale: (type: string, id: string, stale: boolean) => void;
                                    setEntitySyncMetadata: (
                                        type: string,
                                        id: string,
                                        metadata: Partial<EntitySyncMetadata>,
                                    ) => void;
                                    setListError: (
                                        key: string,
                                        error: string | null,
                                        typed?: EntityError | null,
                                    ) => void;
                                    setListFetching: (key: string, fetching: boolean) => void;
                                    setListFetchingMore: (key: string, fetchingMore: boolean) => void;
                                    setListResult: (
                                        key: string,
                                        ids: string[],
                                        meta: Partial<
                                            Omit<ListState, (...) | (...) | (...) | (...) | (...)>,
                                        >,
                                    ) => void;
                                    setListStale: (key: string, stale: boolean) => void;
                                    syncMetadata: {
                                        [x: string]: {
                                            origin: SyncOrigin;
                                            synced: boolean;
                                            updatedAt: number | null;
                                        };
                                    };
                                    unpatchEntity: (type: string, id: string, keys: string[]) => void;
                                    upsertEntities: (
                                        type: string,
                                        entries: { data: Record<(...), (...)>; id: string }[],
                                    ) => void;
                                    upsertEntity: (
                                        type: string,
                                        id: string,
                                        data: Record<string, unknown>,
                                    ) => void;
                                },
                            ) => void
                        ),
                    shouldReplace: true,
                ): void;
            };
            variables?: Record<string, unknown>;
            wsClient: { subscribe: (p: unknown, s: unknown) => () => void };
        }

      Returns () => void