A field called _id
is automatically available to you on the User type. I believe this is true for all types that are tied directly to Collections. This is really why you need to use the Schema file and the graphql docs in the graphql playground in Fauna’s dashboard instead of the file you created yourself. In fact, if you try to add the _id to your type defs and then upload you will get an error.
I believe all you need to do is add the field _id
to the return in your query.
query {
loginUser(username: "Test 1", password: "hello"){
token
logginUser {
_id
username
description
}
}
}