sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ NeptuneGraph/ GetQuery.ts

import type * as neptunegraph from "@distilled.cloud/aws/neptune-graph";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Graph } from "./Graph.ts";

/**
 * Runtime binding for the `GetQuery` operation (IAM action `neptune-graph:GetQueryStatus`),
 * scoped to one {@link Graph}.
 *
 * Retrieves the status of a query running on the bound graph (IAM action `neptune-graph:GetQueryStatus`). Provide the implementation with
 * `Effect.provide(AWS.NeptuneGraph.GetQueryHttp)`.
 * ### Managing Queries
 * **Example:** Check a running query
 * ```typescript
 * const getQuery = yield* NeptuneGraph.GetQuery(graph);
 *
 * const status = yield* getQuery({ queryId });
 * // status.state → "RUNNING" | "WAITING" | "CANCELLING"
 * ```
 *
 * @binding
 */
export interface GetQuery extends Binding.Service<
  GetQuery,
  "AWS.NeptuneGraph.GetQuery",
  (
    graph: Graph,
  ) => Effect.Effect<
    (
      request: Omit<neptunegraph.GetQueryInput, "graphIdentifier">,
    ) => Effect.Effect<neptunegraph.GetQueryOutput, neptunegraph.GetQueryError>
  >
> {}
export const GetQuery = Binding.Service<GetQuery>("AWS.NeptuneGraph.GetQuery");