Update and Delete by unique fields

Yoav Lavi
Yoav Lavi
Jamie Barton
Jamie Barton
Update and Delete by unique fields

We just released support for updating and deleting data by @unique fields — learn more.

Any fields you set as @unique will automatically update the input type used for update and delete mutations.

This change means that how you previously used mutations to update or delete by id must now use the new by argument.

Here's how the new mutations work for a model named Post:

type Post @model {
  id: ID!
  title: String!
  slug: String! @unique
}
  • The id argument no longer exists for query, update or delete. You have to use the new by argument.
  • Grafbase CLI 0.11.0 has been released to include all of the above.

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