The bug is because even though the field id represents an xid and has type String! because of its name we were considering it to be an ID.
So for example the following schema would work
type Tweets {
twitterID: String! @id
score: Int
}
Only when the name of the field with @id directive is id, this would break. We should have been checking for the type of the field instead of the name. I have fixed this in fix(GraphQL): Fix getType queries when id was used as a name for types other than ID by pawanrawal · Pull Request #6130 · dgraph-io/dgraph · GitHub