fenos/dqlx

Issue with edgeAS

iammuho opened this issue · 0 comments

Hey everyone,

First thank you for this amazing repo. My issue is about EdgeAS;

	var output []map[string]interface{}
	_, err := r.Conn.QueryType("User").
		Filter(
			dqlx.UID(uid),
		).
		EdgeAs("total", "friendship", dqlx.Facets(dqlx.And{
			dqlx.GtFn("requested_at", util.BeginningOfDay().Unix()),
			dqlx.LtFn("requested_at", util.EndOfDay().Unix()),
		}), dqlx.Select("uid")).
		EdgeAs("to", "friendship", dqlx.UID(otherUSER), dqlx.Facets(dqlx.And{
			dqlx.GtFn("requested_at", util.BeginningOfWeek().Unix()),
			dqlx.LtFn("requested_at", util.EndOfWeek().Unix()),
		}), dqlx.Select("uid")).
		UnmarshalInto(&output).
		Execute(ctx)

	log.Print(output)

when I run it, I'm getting an error as

"rpc error: code = Unknown desc = line 1 column 35: Expected Left round brackets. Got: lex.Item [9] \"func\" at 1:35",

And the generated DQL is

query Rootquery($0:string, $1:int, $2:int, $3:int, $4:int, $5:string) { to as(func: type(<User>)) @filter(uid($0)) { <hey> @facets((gt(<requested_at>,$1) AND lt(<requested_at>,$2))) { <uid> } <hey> @facets((gt(<requested_at>,$3) AND lt(<requested_at>,$4))) @filter(uid($5)) { <uid> } } }
map[$0:0x57 $1:1662760800 $2:1662847199 $3:1662242400 $4:1662847199 $5:0x56]

anyone can help me ?