Model timestamps added

Chris Nixon
Chris Nixon
Jamie Barton
Jamie Barton
Model timestamps added

We just added two new system fieldscreatedAt and updatedAt!

Grafbase automatically manages the values for both of these fields where you have used the @model directive.

type Post @model {
  title: String!
}

We can see from the examples below that the values for the createdAt and updatedAt fields are automatically managed for us.

mutation {
  postCreate(input: { title: "Hello Grafbase!" }) {
    post {
      id
      title
      createdAt
    }
  }
}
mutation {
  postUpdate(
    by: { id: "post_01GF5N9QMPD33TP3G03X8G86WM" }
    input: { title: "Hello!" }
  ) {
    post {
      id
      createdAt
      updatedAt
    }
  }
}
  • Grafbase CLI 0.9.1 has been released to include all of the above, as well as some minor bug fixes.

We'd love to hear your feedback and ideas, so join us on Discord.