MCPcopy
hub / github.com/dgraph-io/dgraph / getPredicatesFromTypes

Function getPredicatesFromTypes

query/query.go:2798–2812  ·  view source on GitHub ↗

getPredicatesFromTypes returns the list of preds contained in the given types.

(namespace uint64, typeNames []string)

Source from the content-addressed store, hash-verified

2796
2797// getPredicatesFromTypes returns the list of preds contained in the given types.
2798func 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].

Callers 2

expandSubgraphFunction · 0.85
ExpandEdgesFunction · 0.85

Calls 3

StateFunction · 0.92
NamespaceAttrFunction · 0.92
GetTypeMethod · 0.45

Tested by

no test coverage detected