Function: versionQuery()
versionQuery(
directory): (id) =>Promise<void>
Defined in: queries.ts:231
Version a query by it's id.
Takes the latest query and moves it to a versioned directory. All files with this query are also versioned (e.g /queries/GetOrder/schema.json)
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
id | string |
Returns
Promise<void>
Example
import utils from '@eventcatalog/utils';
const { versionQuery } = utils('/path/to/eventcatalog');
// moves the latest GetOrder query to a versioned directory
// the version within that query is used as the version number.
await versionQuery('GetOrder');