Skip to content

Commit

Permalink
chore: catalog_traverse make direction optional
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Sep 13, 2024
1 parent 74ee17e commit d010ed1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion query/config_traversal.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,19 @@ func traverseConfigCELFunction() func(ctx context.Context) cel.EnvOption {

func traverseConfigTemplateFunction() func(ctx context.Context) any {
return func(ctx context.Context) any {
return func(id, relationType, direction string) []models.ConfigItem {
return func(args ...string) []models.ConfigItem {
if len(args) < 2 {
return nil
}
var id, relationType, direction string

id = args[0]
relationType = args[1]
if len(args) == 3 {
direction = args[2]
} else {
direction = "incoming"
}
return TraverseConfig(ctx, id, relationType, direction)
}
}
Expand Down

0 comments on commit d010ed1

Please sign in to comment.