Copy as Markdown[View as Markdown](/docs/sdk/functions/getExamplesFromQuery.md)

***

# Function: getExamplesFromQuery()

> **getExamplesFromQuery**(`directory`): (`id`, `version`?) => `Promise`<`object`\[]>

Defined in: queries.ts:352

Get all examples from a query.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter  | Type     |
| ---------- | -------- |
| `id`       | `string` |
| `version`? | `string` |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`object`\[]>

## Example[​](#example "Direct link to Example")

```
import utils from '@eventcatalog/utils';

const { getExamplesFromQuery } = utils('/path/to/eventcatalog');

const examples = await getExamplesFromQuery('GetOrder');
const examples = await getExamplesFromQuery('GetOrder', '0.0.1');
```
