You can optionally override the path of the query.
@example
import utils from'@eventcatalog/utils'; const{ writeQuery }=utils('/path/to/eventcatalog'); // Write an event to the catalog // Event would be written to queries/GetOrder awaitwriteQuery({ id:'GetOrder', name:'Get Order', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', }); // Write an event to the catalog but override the path // Event would be written to queries/Inventory/GetOrder awaitwriteQuery({ id:'GetOrder', name:'Get Order', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ path:"/Orders/GetOrder"}); // Write a query to the catalog and override the existing content (if there is any) awaitwriteQuery({ id:'GetOrder', name:'Get Order', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ override:true}); // Write a query to the catalog and version the previous version // only works if the new version is greater than the previous version awaitwriteQuery({ id:'GetOrder', name:'Get Order', version:'0.0.1', summary:'This is a summary', markdown:'# Hello world', },{ versionExistingContent:true});
Write a query to EventCatalog.
You can optionally override the path of the query.