Dynamic DQL query with client

To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.

What I want to do

Please list the high level idea of what you want to do

  1. How can I write dynamic query in D-Q-L with go-lang?
`{
		users(func:eq(email@en, email)){
			uid
			firstname
			lastname
		}`

email inside query equal function is it dynamic or static ?
if it’s static then how to write dynamic query in go-lang

What I did

user save data in graph when a new user register. When user login user profile return from graph
Please list the things you have tried.

Dgraph metadata

dgraph version

PASTE THE RESULTS OF dgraph version HERE.

What you are looking for is variables I believe.

query my query($email: string!){
  users(func: eq(email@en, $email)){
    uid
    firstname
    lastname
  }
}

And then you provide a variable map when you send in the query to specify $email without string-building.

2 Likes

Thankyou