Note: Works with ArcGIS for JavaScript 3.35, should work with 4.x
let layer = new GraphicsLayer();
layer.on("graphic-node-add", (event) => {
const title = document.createElementNS("http://www.w3.org/2000/svg", "title");
const isRestaurant = event.graphic.attributes.isRestaurant;