Skip to main content

Creating draft queries

Sometimes, you may want to create a query without immediately publishing it to production. Draft queries allow you to collaborate, gather feedback, or prepare for future changes—without exposing the query as "live" in your catalog

Common Use Cases

  • Collaboration & Feedback
    • Share a draft query with teammates to gather comments and suggestions before it goes live.
  • Versioning with Breaking Changes
    • Introduce a new version of a query that includes breaking changes. Keep it in draft mode until it’s fully reviewed and ready for deployment.
  • Designing Event Lifecycles
    • Use drafts to plan and iterate on query definitions before promoting them to production.

How to add a draft query

To mark an query as a draft, simply add the draft attribute to the frontmatter of the query file.

  • Option 1: Add a draft attribute to your query frontmatter.
  • Option 2: Add a draft object to your query frontmatter. (recommended)
/queries/GetInventoryStock/index.mdx (example)
---
# Uses the default title and summary to mark things as draft in the UI
draft: true

# Or you can specify a title and summary for your draft
draft:
title: "Get Inventory Stock 1.0.1 is in draft"
# Supports markdown
message: |
### New version of Get Inventory Stock query is in draft

This is a new version of the Get Inventory Stock query. It is not yet ready for production. We are still working on it and collecting feedback from the team.
You can use this version in lower environments, **but please be aware that it is still in draft and may change.**
You can still use a previous version of the query, [Get Inventory Stock 1.0.0](/docs/queries/GetInventoryStock/1.0.0), until that version is deprecated.
_If you would like to provide feedback, please contact us at [feedback@eventcatalog.io](mailto:feedback@eventcatalog.io) or our slack channel [Order Management](https://join.slack.com/t/eventcatalog/shared_invite/zt-1q900000000000000000000000000000)_

---

When you mark an query as draft, it will show in the UI as a draft query.

Example

Filtering for Draft Queries

If you want to quickly find draft queries, in your architecture, you can use the discover feature and filter for draft queries.

Example

This will remove all resources, and only show the draft queries.