shopify_draft_proxy/proxy/b2b

B2B company domain port.

Mirrors the local-staging slice from src/proxy/b2b.ts: company, contact, location, role, role-assignment, address, staff-assignment, and tax-setting lifecycle roots stage in normalized in-memory state. Welcome email delivery remains outside local support because it has external Shopify side effects.

Types

pub type B2BError {
  ParseFailed(root_field.RootFieldError)
}

Constructors

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

Constructors

Values

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)
pub fn is_b2b_mutation_root(name: String) -> Bool
pub fn is_b2b_query_root(name: String) -> Bool
pub fn local_has_b2b_id(
  proxy: proxy_state.DraftProxy,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Bool

True iff any string variable names a B2B resource that is already local, deleted locally, or proxy-synthetic. LiveHybrid passthrough is disabled in that case so read-after-write and read-after-delete flows stay on the in-memory B2B model.

pub fn local_has_staged_b2b(
  proxy: proxy_state.DraftProxy,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Bool

True iff any B2B record or deletion has been staged locally, or any variable carries a proxy-synthetic gid. Connection and aggregate reads must stay local once a B2B lifecycle scenario has staged state.

pub fn process(
  store: store.Store,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(json.Json, B2BError)
pub fn process_mutation(
  store: store.Store,
  identity: synthetic_identity.SyntheticIdentityRegistry,
  request_path: String,
  document: String,
  variables: dict.Dict(String, root_field.ResolvedValue),
) -> Result(MutationOutcome, B2BError)
pub fn serialize_company_address_node_by_id(
  store: store.Store,
  id: String,
  selections: List(ast.Selection),
  fragments: dict.Dict(String, ast.Definition),
) -> json.Json
pub fn serialize_company_contact_role_assignment_node_by_id(
  store: store.Store,
  id: String,
  selections: List(ast.Selection),
  fragments: dict.Dict(String, ast.Definition),
) -> json.Json
Search Document