Skip to content

Commit fac1293

Browse files
committed
Examples of finding plans by contents
1 parent 1504e1b commit fac1293

2 files changed

Lines changed: 65 additions & 2 deletions

File tree

docs/api/examples/plan-search.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Plan Search
2+
3+
## Query for Plans with a Specific Activity Directive Type
4+
5+
The query below retrieves all plans that contain an activity directive of a specified type (e.g., "GenerateData"):
6+
7+
```graphql
8+
query QueryPlansWithActivityType {
9+
plan(where: { activity_directives: { type: { _eq: "GenerateData" } } }) {
10+
id
11+
name
12+
activity_directives {
13+
type
14+
arguments
15+
}
16+
}
17+
}
18+
```
19+
20+
## Query for Plans with Activity Directives with a Specific Argument Name
21+
22+
The query below retrieves all plans that contain an activity directive with a specific argument name (e.g., "bin"):
23+
24+
```graphql
25+
query QueryPlansWithArgumentName {
26+
plan(where: { activity_directives: { arguments: { _has_key: "bin" } } }) {
27+
id
28+
name
29+
activity_directives {
30+
type
31+
arguments
32+
}
33+
}
34+
}
35+
```
36+
37+
## Query for Plans with Activity Directives with a Specific Argument Value
38+
39+
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):
40+
41+
```graphql
42+
query QueryByArgValue($argPair: jsonb) {
43+
plan(where: { activity_directives: { arguments: { _contains: $argPair } } }) {
44+
id
45+
name
46+
activity_directives {
47+
type
48+
arguments
49+
}
50+
}
51+
}
52+
```
53+
54+
### Variables
55+
56+
```json
57+
{
58+
"argPair": {
59+
"bin": 20
60+
}
61+
}
62+
```

sidebars.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const sidebars = {
2222
items: [
2323
'api/examples/planning/collaboration',
2424
'api/examples/planning/anchors',
25-
'api/examples/planning/snapshots'
25+
'api/examples/planning/snapshots',
2626
],
2727
},
2828
'api/examples/simulation',
@@ -32,6 +32,7 @@ const sidebars = {
3232
'api/examples/advanced-extensions',
3333
'api/examples/tags',
3434
'api/examples/external-events',
35+
'api/examples/plan-search',
3536
],
3637
},
3738
],
@@ -74,7 +75,7 @@ const sidebars = {
7475
'overview/design/software-design-document',
7576
],
7677
},
77-
'overview/aerie-renamed-to-plandev'
78+
'overview/aerie-renamed-to-plandev',
7879
],
7980
},
8081
{

0 commit comments

Comments
 (0)