Function: getQueries()
getQueries(
directory): (options?) =>Promise<Query[]>
Defined in: queries.ts:128
Returns all queries from EventCatalog.
You can optionally specify if you want to get the latest version of the queries.
Parameters
| Parameter | Type |
|---|---|
directory | string |
Returns
Function
Parameters
| Parameter | Type |
|---|---|
options? | { attachSchema: boolean; latestOnly: boolean; } |
options.attachSchema? | boolean |
options.latestOnly? | boolean |
Returns
Promise<Query[]>
Example
import utils from '@eventcatalog/utils';
const { getQueries } = utils('/path/to/eventcatalog');
// Gets all queries (and versions) from the catalog
const queries = await getQueries();
// Gets all queries (only latest version) from the catalog
const queries = await getQueries({ latestOnly: true });
// Gets all queries with the schema attached
const queries = await getQueries({ attachSchema: true });