package graph_queries

const DefaultID = "default"

var definitions = []Definition{
	{Meta: Meta{ID: DefaultID, Label: "Default"}, EdgeQuery: defaultEdgeQuery, PredicateQuery: defaultPredicateQuery},
	{Meta: Meta{ID: "hierarchy", Label: "Hierarchy"}, EdgeQuery: hierarchyEdgeQuery, PredicateQuery: hierarchyPredicateQuery},
	{Meta: Meta{ID: "types", Label: "Types"}, EdgeQuery: typesOnlyEdgeQuery, PredicateQuery: typesOnlyPredicateQuery},
}

func List() []Meta {
	out := make([]Meta, 0, len(definitions))
	for _, d := range definitions {
		out = append(out, d.Meta)
	}
	return out
}

func Get(id string) (Definition, bool) {
	for _, d := range definitions {
		if d.Meta.ID == id {
			return d, true
		}
	}
	return Definition{}, false
}
