markhuot / craftql

A drop-in GraphQL server for Craft CMS
Other
320 stars 53 forks source link

Expose expiry date for mutations #181

Open alexcarpenter opened 6 years ago

alexcarpenter commented 6 years ago

I am looking to set an expiry date when an entry is created via a mutation (postDate + 30days).

markhuot commented 6 years ago

dev-master (on composer) now has the ability to set the postDate and expiryDate as unix timestamps. You can use it as follows,

mutation{
  upsertBlog(
    title:"foo",
    postDate:1514829600,
    expiryDate:1514829600
  ) {
    id
  }
}

Note: I'll leave this ticket open until this makes it in to a stable release.