Hi @secretshardul
If you are trying to set an external ID, please use the schema as below.
type Student {
studentId: String! @id
name: String
}
You need to add types to your mutation (as Anthony mentioned) as below. I added this through a Ratel mutation on a slash endpoint.
{
set{
_:Student.1 <Student.studentId> "1" .
_:Student.1 <Student.name> "Jack" .
_:Student.1 <dgraph.type> "Student" .
_:Student.2 <Student.studentId> "2" .
_:Student.2 <Student.name> "John" .
_:Student.2 <dgraph.type> "Student" .
}
}
Finally, you can query through Slash API Explorer.
query MyQuery {
getStudent(studentId: "1") {
name
}
}
The result is as below.
{
"data": {
"getStudent": {
"name": "Jack"
}
}
}