Skip to content

Instantly share code, notes, and snippets.

@conradludgate
Last active February 11, 2023 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conradludgate/4eca6f243cd77104fa77d7b4196bf37d to your computer and use it in GitHub Desktop.
Save conradludgate/4eca6f243cd77104fa77d7b4196bf37d to your computer and use it in GitHub Desktop.
trustfall-hytradboi-query-plan
QueryPlan {
plan: [
GetStartingTokens {
edge: "HackerNewsTop",
vid: Vid(
1,
),
},
Coerce {
coerced_from: "HackerNewsItem",
coerce_to: "HackerNewsStory",
vid: Vid(
1,
),
},
ProjectProperty {
type_name: "HackerNewsStory",
vid: Vid(
1,
),
field_name: "score",
},
Argument(
"min_score",
),
Filter(
GreaterThanOrEqual(
Variable(
VariableRef {
variable_name: "min_score",
variable_type: Type {
base: Named(
Name(
"Int",
),
),
nullable: false,
},
},
),
),
),
Record(
Vid(
1,
),
),
Activate(
Vid(
1,
),
),
Expand {
optional: false,
neighbors: ProjectNeighbors {
type_name: "HackerNewsStory",
edge_name: "link",
parameters: None,
eid: Eid(
1,
),
vid: Vid(
1,
),
},
},
Coerce {
coerced_from: "Webpage",
coerce_to: "GitHubRepository",
vid: Vid(
2,
),
},
Record(
Vid(
2,
),
),
Activate(
Vid(
2,
),
),
Expand {
optional: false,
neighbors: ProjectNeighbors {
type_name: "GitHubRepository",
edge_name: "workflows",
parameters: None,
eid: Eid(
2,
),
vid: Vid(
2,
),
},
},
Record(
Vid(
3,
),
),
Activate(
Vid(
3,
),
),
Expand {
optional: false,
neighbors: ProjectNeighbors {
type_name: "GitHubWorkflow",
edge_name: "jobs",
parameters: None,
eid: Eid(
3,
),
vid: Vid(
3,
),
},
},
Record(
Vid(
4,
),
),
Activate(
Vid(
4,
),
),
Expand {
optional: false,
neighbors: ProjectNeighbors {
type_name: "GitHubActionsJob",
edge_name: "step",
parameters: None,
eid: Eid(
4,
),
vid: Vid(
4,
),
},
},
Coerce {
coerced_from: "GitHubActionsStep",
coerce_to: "GitHubActionsImportedStep",
vid: Vid(
5,
),
},
Record(
Vid(
5,
),
),
MoveTo(
Vid(
5,
),
),
ProjectProperty {
type_name: "GitHubActionsImportedStep",
vid: Vid(
5,
),
field_name: "uses",
},
MoveTo(
Vid(
1,
),
),
ProjectProperty {
type_name: "HackerNewsStory",
vid: Vid(
1,
),
field_name: "score",
},
MoveTo(
Vid(
4,
),
),
ProjectProperty {
type_name: "GitHubActionsJob",
vid: Vid(
4,
),
field_name: "name",
},
MoveTo(
Vid(
2,
),
),
ProjectProperty {
type_name: "GitHubRepository",
vid: Vid(
2,
),
field_name: "url",
},
MoveTo(
Vid(
5,
),
),
ProjectProperty {
type_name: "GitHubActionsImportedStep",
vid: Vid(
5,
),
field_name: "name",
},
MoveTo(
Vid(
3,
),
),
ProjectProperty {
type_name: "GitHubWorkflow",
vid: Vid(
3,
),
field_name: "name",
},
MoveTo(
Vid(
3,
),
),
ProjectProperty {
type_name: "GitHubWorkflow",
vid: Vid(
3,
),
field_name: "path",
},
CollectOutputs(
[
"action",
"hn_score",
"job",
"repo_url",
"step",
"workflow",
"workflow_path",
],
),
],
}
{
HackerNewsTop(max: 200) {
... on HackerNewsStory {
hn_score: score @filter(op: ">=", value: ["$min_score"]) @output
link {
... on GitHubRepository {
repo_url: url @output
workflows {
workflow: name @output
workflow_path: path @output
jobs {
job: name @output
step {
... on GitHubActionsImportedStep {
step: name @output
action: uses @output
}
}
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment