I need the query to get date modified on item versions for an item.
1 Answer
You need to read the field __updated
which will hold the value of the updated date of the item. Below is how your GraphQL will look like:
{
item(path: "/sitecore/Content/Home", language: "en") {
name
versions {
path
field(name: "__updated"){
value
}
}
}
}
The result:
Note that if you want to add the name of the user who modified the item, you should use the name __updated by
. Below is a snippet when using the __updated by
{
item(path: "/sitecore/Content/Home", language: "en") {
name
versions {
path
updatedby: field(name: "__updated by") {
value
}
updatedDate: field(name: "__updated"){
value
}
}
}
}
Outcome: