AlmondTill/G3N API

resolvePolicyValue

query · in the family Operating policy

What it does

What policy value applies right now (or at a chosen moment) for a location or organization.

Resolve the effective policy value for (scope × key) at an instant. 'at' absent = the server's now (past instants are legal — historical reconstruction is a read). What this quotes is exactly what the platform applies. An unknown key refuses naming the registry roster. Template class A18_POLICY (sensitive config — owner/manager).

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Operating policy — The operational policies and thresholds your organization runs by.

Roles that may call it:

What happens

Reads only — exactly the value the platform applies: the location’s own window, else its organization’s, else the platform default.

Arguments

NameTypeRequiredNotes
keyString String!yes
organizationIdID ID!yes
logicalFacilityIdIDno
atStringno

Returns

PolicyResolution PolicyResolution! — The effective resolved policy value for one (scope × key) at one instant: the winning nearest-ancestor record's identity + window, or the registry-default floor (source = default, record fields null). Resolution never misses.

Example request

graphql
query ExampleResolvePolicyValue($key: String!, $organizationId: ID!, $logicalFacilityId: ID) {
  resolvePolicyValue(key: $key, organizationId: $organizationId, logicalFacilityId: $logicalFacilityId) {
    key
    valueInt
    source
    recordId
    level
    startAt
    endAt
  }
}

Variables:

json
{
  "key": "<key>",
  "organizationId": "01900000-0000-7000-8000-1971e30a0000",
  "logicalFacilityId": "01900000-0000-7000-8000-10c08c590000"
}

Example response

json
{
  "data": {
    "resolvePolicyValue": {
      "key": "<key>",
      "valueInt": 1,
      "source": "<source>",
      "recordId": "01900000-0000-7000-8000-9f4565ec0000",
      "level": "<level>",
      "startAt": "2027-01-31T00:00:00.000Z",
      "endAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in