Skip to content

Instantly share code, notes, and snippets.

@conradludgate
Last active February 11, 2023 12:10
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/757fbf5cba1d4b12a1248ece69a8c8aa to your computer and use it in GitHub Desktop.
Save conradludgate/757fbf5cba1d4b12a1248ece69a8c8aa to your computer and use it in GitHub Desktop.
trustfall query plan folds
QueryPlan {
plan: [
GetStartingTokens {
edge: "Feed",
vid: Vid(
1,
),
},
Record(
Vid(
1,
),
),
Activate(
Vid(
1,
),
),
Expand {
optional: false,
neighbors: ProjectNeighbors {
type_name: "Feed",
edge_name: "title",
parameters: None,
eid: Eid(
1,
),
vid: Vid(
1,
),
},
},
Record(
Vid(
2,
),
),
Activate(
Vid(
1,
),
),
Fold {
neighbors: ProjectNeighbors {
type_name: "Feed",
edge_name: "links",
parameters: None,
eid: Eid(
2,
),
vid: Vid(
1,
),
},
first: NewWithImported,
plan: [
Record(
Vid(
3,
),
),
Collect(
Eid(
2,
),
),
RemoveTags(
[],
),
],
},
FoldOutputs {
eid: Eid(
2,
),
vid: Vid(
1,
),
output_names: [
"links_href",
"links_title",
],
outputs: {
"links_href": ContextField {
vertex_id: Vid(
3,
),
field_name: "href",
field_type: Type {
base: Named(
Name(
"String",
),
),
nullable: false,
},
},
"links_title": ContextField {
vertex_id: Vid(
3,
),
field_name: "title",
field_type: Type {
base: Named(
Name(
"String",
),
),
nullable: true,
},
},
},
fold_outputs: {},
folds: {},
plan: [
MoveTo(
Vid(
3,
),
),
ProjectProperty {
type_name: "FeedLink",
vid: Vid(
3,
),
field_name: "href",
},
MoveTo(
Vid(
3,
),
),
ProjectProperty {
type_name: "FeedLink",
vid: Vid(
3,
),
field_name: "title",
},
],
},
MoveTo(
Vid(
1,
),
),
ProjectProperty {
type_name: "Feed",
vid: Vid(
1,
),
field_name: "feedType",
},
MoveTo(
Vid(
1,
),
),
ProjectProperty {
type_name: "Feed",
vid: Vid(
1,
),
field_name: "id",
},
MoveTo(
Vid(
2,
),
),
ProjectProperty {
type_name: "FeedText",
vid: Vid(
2,
),
field_name: "content",
},
MoveTo(
Vid(
2,
),
),
ProjectProperty {
type_name: "FeedText",
vid: Vid(
2,
),
field_name: "contentType",
},
MoveTo(
Vid(
2,
),
),
ProjectProperty {
type_name: "FeedText",
vid: Vid(
2,
),
field_name: "src",
},
CollectOutputs(
[
"feedType",
"id",
"title_content",
"title_contentType",
"title_src",
],
),
],
}
{
Feed {
id @output
feedType @output
title_: title {
src @output
content @output
contentType @output
}
links_: links @fold {
title @output
href @output
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment