fonto:resolve-permanent-id

Type: Function

Resolve a permanent id. Warning: this function may have side effects. Calling this function may start a reference resolve call to the CMS. Please refrain from calling this function with bogus data.

Output is one of the following:

  • If the permanent id is not resolved yet: {state: 'resolving'}

  • If the permanent id failed to resolve: {state:'error'}

  • If the permanent id is resolved:

map {
  state: 'done',
  value: map {
    target: 'the target',
    referenceType: 'referenceType',
    metadata: map {}
  }
}

Arguments

# Name Type Description
1. permanentId String

The permanentId that is being resolved

Example

let $res := fonto:resolve-permanent-id($permanent-id)
return if ($res?state != "done") then "Loading..."
else "I resolved to " || $res?value?target
Was this page helpful?