Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions docs/api/examples/plan-search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Plan Search

## Query for Plans with a Specific Activity Directive Type

The query below retrieves all plans that contain an activity directive of a specified type (e.g., "GenerateData"):

```graphql
query QueryPlansWithActivityType {
plan(where: { activity_directives: { type: { _eq: "GenerateData" } } }) {
id
name
activity_directives {
type
arguments
}
}
}
```

## Query for Plans with Activity Directives with a Specific Argument Name

The query below retrieves all plans that contain an activity directive with a specific argument name (e.g., "bin"):

```graphql
query QueryPlansWithArgumentName {
plan(where: { activity_directives: { arguments: { _has_key: "bin" } } }) {
id
name
activity_directives {
type
arguments
}
}
}
```

## Query for Plans with Activity Directives with a Specific Argument Value

The query below and the variables that follow retrieves all plans that contain an activity directive with a specific argument value (e.g., "bin" equal to 20):

```graphql
query QueryByArgValue($argPair: jsonb) {
plan(where: { activity_directives: { arguments: { _contains: $argPair } } }) {
id
name
activity_directives {
type
arguments
}
}
}
```

### Variables

```json
{
"argPair": {
"bin": 20
}
}
```
5 changes: 3 additions & 2 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const sidebars = {
items: [
'api/examples/planning/collaboration',
'api/examples/planning/anchors',
'api/examples/planning/snapshots'
'api/examples/planning/snapshots',
],
},
'api/examples/simulation',
Expand All @@ -32,6 +32,7 @@ const sidebars = {
'api/examples/advanced-extensions',
'api/examples/tags',
'api/examples/external-events',
'api/examples/plan-search',
],
},
],
Expand Down Expand Up @@ -74,7 +75,7 @@ const sidebars = {
'overview/design/software-design-document',
],
},
'overview/aerie-renamed-to-plandev'
'overview/aerie-renamed-to-plandev',
],
},
{
Expand Down