Thanks @mbande for providing the data files. I was able to reproduce the issue.
Inside users_simple.json file, dgraph.type attribute has not been set which is resulting in this behaviour. You need to explicitly set the dgraph.type attribute so that DQL or GraphQL queries could get to know type of a node.
I added dgraph.type attribute to the two entities as follows
[
{"User.id": "1", "dgraph.type": "User", "User.username": "a", "followees": [{"User.username": "b", "User.id": "2"}, {"User.username": "c", "User.id": "3"}]},
{"User.id": "2", "dgraph.type": "User", "User.username": "b", "followees": [{"User.username": "c", "User.id": "3"}]}
]
After adding dgraph.type, the query
{
getUser(func: eq(dgraph.type, User)) {
count(uid)
}
}
returns
"data": {
"getUser": [
{
"count": 2
}
]
}
The GraphQL query
query{
queryUser{
id
username
}
}
returns
"data": {
"queryUser": [
{
"id": "1",
"username": "a"
},
{
"id": "2",
"username": "b"
}
]
}