Once you have Dgraph up and running, press run on the panel to the right. This will load a schema into Dgraph for us to use in the first steps of the tutorial. Don’t worry too much about the syntax for now, we’ll cover all that in later lessons, just check in the response panel that the operation was a success.
Note that Schema changes are made via Alter operations only. All clients have an operation for Mutate, Query and Alter.
# Define Types
type Person {
name
age
friend
owns_pet
}
type Animal {
name
}
# Define Directives and index
name: string @index(term) @lang .
age: int @index(int) .
friend: [uid] @count .
owns_pet: [uid] .
1.3 Load Schema