Metadata
Describes metadata for Content schema for querying content using GraphQL from Optimizely Content Management System (CMS) (SaaS).
IContentMetadata
The common base schema _Content
, that all content types inherit, has a property _metadata
of type IContentMetadata
.
Content can be displayed as stand-alone instances and as part of other content inside content areas. IContentMetadata
is the common signature for content metadata regardless of whether it is a stand-alone or part of another instance.
The schema IContentMetadata
consists of:
Property | Type | Description |
---|---|---|
key | String | Unique identifier of a content instance. The key currently uses a UUID-based format, but this may change, and you should treat the key as an opaque string. |
locale | String | The locale is in the format 'language code-country', like 'en-US'. For invariant cultures, the country is omitted, like 'en'. Content that is not localizable has an empty string value. |
version | String | The version uses an integer-based format, but this may change, and you should treat the version as an opaque string. The version identifier is guaranteed to be unique across versions with the same key. |
url | ContentUrl | The URL for the content item. The URL consists of several parts depending on the type of content and the application definitions. See Property Schemas-ContentUrl for information. |
types | [String] | A list of types, where the first item is the content type and then base types. |
published | DateTime | A datetime specified when the content instance was published. For drafts, published is null. It can also be a future datetime and is then filtered from public queries until the published time is the present time. |
status | String | Specifies the status of the content version. See Content version status values |
created | DateTime | A datetime specified when the first content version in the current locale was created. |
lastModified | DateTime | Specifies when the content version was last modified. |
InstanceMetadata
For stand-alone instances, _metadata
can be cast to InstanceMetadata
, which inherits IContentMetadata
but adds more properties. An example of a query that casts to InstanceMetadata
is:
query RouteSegmentQuery {
_Page {
items {
_metadata {
displayName
... on InstanceMetadata {
routeSegment
}
}
}
}
}
The schema InstanceMetadata
consists of:
Property | Type | Description |
---|---|---|
locales | [String] | Specifies the locales where the content exists. |
expired | DateTime | A datetime that specifies when the content instance expires. If the date is a time that as passed, the content be filtered from public queries. |
container | String | The key of the content instance that contains this instance. |
owner | String | If the content is in an asset to another content then this specifies the owning content. |
routeSegment | String | Specifies the route segment for this content instance. For components or blocks that are not routable, this is |
lastModifiedBy | String | Specifies who last updated the content version. |
createdBy | String | Specifies who created the first version in the current locale. |
path | [String] | Specifies the hierarchy of containers. |
MediaMetadata
For media content instances, _metadata
be cast to MediaMetadata
, like:
query MimeTypeQuery {
_Media {
items {
_metadata {
displayName
... on MediaMetadata {
mimeType
}
}
}
}
}
The schema MediaMetadata
consists of:
Property | Type | Description |
---|---|---|
thumbnail | String | The URL for a thumbnail of the media content instance. |
mimeType | String | Specifies the mime type for the media content instance. |
content | String | Contains extracted content from the media instance. See Text extraction field. |
Updated about 2 months ago