Default directive added

Jakub WieczorekJakub WieczorekJamie BartonJamie Barton
Default directive added

The Grafbase Database is deprecated. Use connectors to federate your existing data sources.

We're extremely happy to announce the release of the @default directive.

You can now set default values for fields in your schema using the @default directive:

type Review @model { message: String! rating: Int @default(value: 5) published: Boolean @default(value: false) }

Now all that's required to create a review is the message value. The rating and published will use the default!

mutation { reviewCreate(input: { message: "Awesome product!" }) { review { id message rating published } } }
Youtube video thumbnail

Learn more about working with the @default directive.

  • Grafbase CLI 0.9.0 has been released to include all of the above.

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