Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

867 B
Raw Blame
import type { AnyVariables } from '@urql/core';
import type { Accessor } from 'solid-js';
import { createBaseQuery } from './create-base-query';
import { createQueryObserver } from './query-observer';
import type { UrqlQueryOptions, UrqlQueryResult } from './types';

/**
 * Creates a live Solid binding over one urql query observer.
 *
 * New single-document reads use `createLiveQuery`, a document-first wrapper
 * over this binding. Existing callers are already live and need no migration.
 */
export function createUrqlQuery<
  QueryData = unknown,
  Variables extends AnyVariables = AnyVariables,
  Data = QueryData,
>(
  getOptions: Accessor<UrqlQueryOptions<QueryData, Variables, Data>>
): UrqlQueryResult<Data, Variables, QueryData> {
  return createBaseQuery(
    getOptions,
    createQueryObserver<QueryData, Variables, Data>,
    'createUrqlQuery'
  );
}