dqlx icon indicating copy to clipboard operation
dqlx copied to clipboard

Expand(_all_) DQL feature

Open droslean opened this issue 3 years ago • 5 comments

@fenos Is there a way to .Select() all of the fields instead? Also, is there a way to inject expand(_all_) in the selection?

droslean avatar Aug 03 '22 15:08 droslean

Trying something like:

Select(`
	uid
        expand(_all_)\{
		expand(_all_)
           \}
	`)

Also, this can be consider as bug, right?

  "message": "rpc error: code = Unknown desc = : while converting to subgraph: expand(_all_) not allowed multiple times in same sub-query.",

droslean avatar Aug 03 '22 16:08 droslean

@fenos Is there any workaround?

droslean avatar Aug 04 '22 14:08 droslean

Hi @droslean you can try using the Edge function something along this line:

Select(`uid`).Edge("expand(_all_)", dqlx.Select(`
       expand(_all_)
`)).

fenos avatar Aug 04 '22 17:08 fenos

@fenos I tried what you suggested, but the response still doesn't include any predicates.

droslean avatar Aug 04 '22 22:08 droslean

It seems that the query is constructed with <expand(_all_)> instead of expand(_all_). For some reason, dgraph is ignoring the expand if it is surrounded with <>.

droslean avatar Aug 04 '22 22:08 droslean