Panics on checkPassword with alias

Following query:

verify: checkUserPassword(email:"",passwd:"mysecret") {

works OK with dgraph/dgraph:v20.11.0-rc1-9-ge5785d9e0, but panics with dgraph/dgraph:v20.11.0-rc2-5-g2188e742c or dgraph/dgraph:master with:

panic: runtime error: index out of range [0] with length 0.
 trace: goroutine 1274 [running]:
runtime/debug.Stack(0xc0027e9870, 0x1c6d560, 0xc00109c140)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
	/ext-go/1/src/ +0x57
panic(0x1c6d560, 0xc00109c140)
	/usr/local/go/src/runtime/panic.go:969 +0x166, 0xc001c18d20, 0xc001fa8be0, 0x7fcd79e8e438, 0xc001c18d20, 0xc0018c6180)
	/ext-go/1/src/ +0x99a*queryRewriter).Rewrite(0x30366e8, 0x1fccf00, 0xc001c18510, 0x1ff1180, 0xc001c18d20, 0x0, 0xc001c18db0, 0x8)
	/ext-go/1/src/ +0x5e1*queryResolver).rewriteAndExecute(0xc001c18d50, 0x1fccf00, 0xc001c18510, 0x1ff1180, 0xc001c18d20, 0xc001c18d50)
	/ext-go/1/src/ +0x22c*queryResolver).Resolve(0xc001c18d50, 0x1fccf00, 0xc001c18510, 0x1ff1180, 0xc001c18d20, 0x0)
	/ext-go/1/src/ +0x32d*RequestResolver).Resolve.func2.1(0xc0018c6164, 0xc0006ca080, 0x1, 0x1, 0xc0025f8400, 0x1fccf00, 0xc001c18510, 0x1ff1180, 0xc001c18d20, 0x0)
	/ext-go/1/src/ +0x165
created by*RequestResolver).Resolve.func2
	/ext-go/1/src/ +0x1e0

Thanks for reporting the bug. I am trying to reproduce this.
Can you share schema or the fields of type User ?

Sure. Schema:

type User @secret(field:"passwd") {
  email: String! @id @search(by: [hash])
  first_name: String @search(by: [hash])
  last_name: String @search(by: [hash])


mutation {
  ]) {numUids}

Thanks, I was able to reproduce this. I have marked the status as accepted. A fix will be merged to master branch soon.

The fix for this issue has been merged to master over here: Fix(GraphQL): Fix bug with password query rewriting by vmrajas · Pull Request #7011 · dgraph-io/dgraph · GitHub . Let us know if you face any other issues.
Once again, Thanks for trying out the feature and reporting the bug.

Thanks, everything works as expected for master. Looking forward to a new tagged rc2 docker image.