I’m using dgraph-js
with node. When performing an operation such as a schema update, I want to send back some sort of acknowledgement indicating the success or failure of the operation. In case of success, I’d like to send back something meaningful, such as echoing back the updated schema.
I’m playing around with the return value of dgraphClient.alter()
, but as far as I can tell, it’s mostly unintelligible:
{
"wrappers_": null,
"arrayIndexOffset_": -1,
"array": [],
"pivot_": 1.7976931348623157e+308,
"convertedFloatingPointFields_": {}
}
Any suggestions on how to improve the response? The code I’m using looks something like
export async function initDatabase() {
const schema = `
name: string @index(fulltext) .
email: string @index(exact) .
uuid: string @index(exact) .
`;
const op = new dgraph.Operation();
op.setSchema(schema);
const result = await dgraphClient.alter(op);
return result
}