UmweltDocs
Reference/Queries/entity.resolve
entity.resolvequerysince 0.1

Finds an entity by the id another system gives it.

Request
umwelt call story.umw entity.resolve '{
  "projectId": "ball",
  "externalRef": { "system": "game", "id": "npc-12" }
}'
Request
const result = await client.entityResolve({ projectId: 'ball', externalRef: { system: 'game', id: 'npc-12' } });
Request
var result = engine.EntityResolve(new ResolveEntityPayload
{
    ProjectId = "ball",
    ExternalRef = new ExternalRef { System = "game", Id = "npc-12" },
});
Response
{
  "id": "guard",
  "projectId": "ball",
  "name": "The guard",
  "aliases": [],
  "typeId": "person",
  "archived": false,
  "createdAt": { "tick": 0 },
  "externalRef": { "id": "npc-12", "system": "game" },
  "fields": {}
}

Payload

FieldTypeDescription
projectIdrequiredstringThe project to read.
externalRefrequiredExternalRefThe reference: { system, id }.

Result

FieldTypeDescription
idalwaysstringThe entity’s id, given or generated.
projectIdalwaysstringThe project it belongs to.
typeIdalwaysstringIts entity type, which decides whether it can hold knowledge.
namealwaysstringIts name.
aliasesstring[]Other names it goes by.
fieldsobjectValues for the fields its type declares.
externalRefExternalRefThe id another system gives it: { system, id }.
createdAtalwaysPositionThe position it exists from. Defaults to { "tick": 0 }.
archivedalwaysbooleanSet by entity.archive. It changes nothing else.

Rules

One reference, one entity. An external reference is unique per project.

Errors

VALIDATION_FAILEDThe payload is malformed.
NOT_FOUNDThe project does not exist, or no entity has the reference.
HANDSHAKE_REQUIREDOver the protocol, hello was not sent first.

Every code is listed in Errors.

See also

Was this page helpful?