Generic repository object searches
A search for any searchable class of object can be executed with the repositoryObjects()
query.
This example assumes there is a CmAbstractPersistable sub-class called
CustomContact. It has properties such as CustomString and
CustomAddresses. CustomAddresses is an Enum object valued property
associated with another CmAbstractPersistable sub-class of
CustomAddress with properties such as CustomCity and
CustomStreet.
The following example shows how Enum properties, included with the generic properties field, can
be further expanded and shaped in the output data.
{
repositoryObjects(
repositoryIdentifier:"OS1"
from:"CustomContact"
where:"DateCreated > 20190101T080000Z"
orderBy:"DateCreated DESC"
pageSize:20
)
{
independentObjects {
className
objectReference {
repositoryIdentifier
classIdentifier
identifier
}
properties(includes: ["Creator", "DateCreated", "CustomString", "CustomAddresses"]) {
id
label
type
cardinality
value
... on EnumProperty {
independentObjectSetValue {
independentObjects {
className
properties(includes:["CustomCity","CustomStreet"]) {
id
label
type
cardinality
value
}
}
}
}
}
}
pageInfo {
token
}
}
}
Additional pages can be obtained by calling
moreIndependentObjects(). Any search
can be continued by calling moreIndependentObjects(), even partial results returned
for enum style fields and
properties.{
moreIndependentObjects(
token:"<insert_token>"
)
{
independentObjects {
className
objectReference {
classIdentifier
identifier
}
properties(includes: ["Creator", "DateCreated", "CustomString", "CustomAddresses"]) {
id
label
type
cardinality
value
... on EnumProperty {
independentObjectSetValue {
independentObjects {
className
properties(includes:["CustomCity","CustomStreet"]) {
id
label
type
cardinality
value
}
}
}
}
}
}
pageInfo {
token
}
}
}