Thanks for the reply, @MichelDiz.
Literally doing dgraph.type: 'User' is a JavaScript syntax error (a period is not allowed in the key of an object, without quoting the key).
This is why I commented that I had tried 'dgraph.type': 'User', which is valid JavaScript syntax for an object key that has a period in it.
I must be missing something really simple.