Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with edgeAS #21

Open
iammuho opened this issue Sep 10, 2022 · 0 comments
Open

Issue with edgeAS #21

iammuho opened this issue Sep 10, 2022 · 0 comments

Comments

@iammuho
Copy link

iammuho commented Sep 10, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant