Hi. I am new in dgraph. I tried to alter my Schema follow the docs page:
type Todo {
id: ID!
task: String
owner: Owner
}
type Owner {
name: String! @id
todo: [Todo] @hasInverse(field:"owner")
}
And I got this error:
Init Schema error: rpc error: code = Unknown desc = while lexing
.....
at line 10 column 35: Invalid schema. Unexpected "
Next. I tried to make a very simple schema:
type Todo {
id: ID!
task: String
}
Then I got.
Init Schema error: rpc error: code = Unknown desc = Schema does not contain a matching predicate for field id in type Todo
I am using dgraph v21.03.2
Am I using the wrong version? Please let me know.
If I use something like this:
<email>: string @index(exact) .
<first_name>: string .
<last_name>: string .
<password>: string .
type <User> {
email
password
first_name
last_name
}
It works. This is from the docs of https://github.com/dgraph-io/dgo
But I want to use the newest feature on official page of dgraph. Hope someone can help me. Many thanks