shopify_draft_proxy/proxy/customers

Customer domain port foundation.

Mirrors the normalized-state approach in src/proxy/customers.ts: customer writes stage locally, downstream reads resolve from effective in-memory state, and outbound/customer-visible side effects are represented as local intent only.

Types

pub type CustomersError {
  ParseFailed(root_field.RootFieldError)
}

Constructors

pub type MutationOutcome {
  MutationOutcome(
    data: json.Json,
    store: store.Store,
    identity: synthetic_identity.SyntheticIdentityRegistry,
    staged_resource_ids: List(String),
  )
}

Constructors

Values

pub fn handle_customer_query(
  proxy: proxy_state.DraftProxy,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(json.Json, CustomersError)
pub fn handle_query_request(
  proxy: proxy_state.DraftProxy,
  request: proxy_state.Request,
  parsed: parse_operation.ParsedOperation,
  primary_root_field: String,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> #(proxy_state.Response, proxy_state.DraftProxy)

Domain entrypoint for the customer query path. The dispatcher always lands here for customer-domain reads regardless of read_mode; the handler itself decides whether to compute the answer from local state or to forward to upstream verbatim via passthrough.passthrough_sync (when in LiveHybrid mode and the operation is one we know we can’t satisfy locally — see should_passthrough_in_live_hybrid).

pub fn is_customer_mutation_root(name: String) -> Bool
pub fn is_customer_query_root(name: String) -> Bool
pub fn local_has_customer_id(
  proxy: proxy_state.DraftProxy,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Bool

True iff the requested customer(id:) argument resolves to a customer that’s already in local state (base or staged). Used by the dispatcher to skip LiveHybrid passthrough when a prior staged mutation has already produced the record we’d otherwise fetch — e.g. a customerCreate followed by customer(id: <newly staged synthetic gid>) in the same scenario.

pub fn process(
  proxy: proxy_state.DraftProxy,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(json.Json, CustomersError)
pub fn process_mutation(
  proxy: proxy_state.DraftProxy,
  request_path: String,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(MutationOutcome, CustomersError)
pub fn process_mutation_with_upstream(
  proxy: proxy_state.DraftProxy,
  request_path: String,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
  upstream: upstream_query.UpstreamContext,
) -> Result(MutationOutcome, CustomersError)
pub fn serialize_customer_node_by_id(
  store: store.Store,
  id: String,
  selections: List(ast.Selection),
  fragments: dict.Dict(String, ast.Definition),
) -> json.Json
pub fn wrap_data(data: json.Json) -> json.Json
Search Document