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
I want to use uniq field like username according https://dgraph.io/docs/graphql/schema/ids/
Please list the high level idea of what you want to do
To have unique vertexes (like person e.g.) that adding independently in parallel threads (or in even servers) in one moment.
What I did
Please list the things you have tried.
const Schema = `
username: string @index(term, fulltext) @upsert @count .
type Username {
username: String! @id
}
`
` if err := dg.Alter(context.Background(), &api.Operation{
Schema: Schema,
RunInBackground: false,
}); err != nil {
return err
}`
I’m getting error:
panic: rpc error: code = Unknown desc = line 34 column 24: Expected new line after field declaration. Got @
Dgraph metadata
dgraph version
Dgraph version : v21.12.0
Dgraph codename : zion
Dgraph SHA-256 : 078c75df9fa1057447c8c8afc10ea57cb0a29dfb22f9e61d8c334882b4b4eb37
Commit SHA-1 : d62ed5f15
Commit timestamp : 2021-12-02 21:20:09 +0530
Branch : HEAD
Go version : go1.17.3
jemalloc enabled : true