How to Pass Predicates Stored in a Variable to expand() Function

In DGraph documentation, it is mentioned that we can use expand() function in four ways. One of them is:

  • Predicates can be stored in a variable and passed to expand() to expand all the predicates in the variable

Could someone please give an example as to how it can be achieved?

Sorry for the late answer, I missed that one.

This was deprecated since the _predicate_ feature was removed in favor of the new Type System. You can see the usage in the old docs https://docs.dgraph.io/v1.0.8/query-language/#expand-predicates

I think this needs to be removed from docs after some checks. Today, what you can do is use expand type e.g: expand(Person)

UPDATE: Github Issue to track this https://github.com/dgraph-io/dgraph/issues/4561

1 Like

@utekaravinash @MichelDiz I have raised a PR to update docs about expand function.

1 Like