How to get the modified date and time for item versions in Sitecore via Graphql query
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:
Read more here: Source link