Thank you, @MichelDiz! My problem turned out to be completely unrelated. It turns out I wasn’t properly destructuring the object I was passing to mutation.setSetJson(). In fact, the simplified example in my first post is wrong. I was actually doing this and not realizing it:
mutation.setSetJson({
user: {
email: 'foo@example.com',
name: 'Foo',
'dgraph.type': 'User',
uid: '_:user'
}
})
At any rate, thanks again for your help. Doing 'dgraph.type': 'User' definitely works!