getPredicatesFromTypes returns the list of preds contained in the given types.
(namespace uint64, typeNames []string)
| 2796 | |
| 2797 | // getPredicatesFromTypes returns the list of preds contained in the given types. |
| 2798 | func getPredicatesFromTypes(namespace uint64, typeNames []string) []string { |
| 2799 | var preds []string |
| 2800 | |
| 2801 | for _, typeName := range typeNames { |
| 2802 | typeDef, ok := schema.State().GetType(x.NamespaceAttr(namespace, typeName)) |
| 2803 | if !ok { |
| 2804 | continue |
| 2805 | } |
| 2806 | |
| 2807 | for _, field := range typeDef.Fields { |
| 2808 | preds = append(preds, field.Predicate) |
| 2809 | } |
| 2810 | } |
| 2811 | return preds |
| 2812 | } |
| 2813 | |
| 2814 | // filterUidPredicates takes a list of predicates and returns a list of the predicates |
| 2815 | // that are of type uid or [uid]. |
no test coverage detected