This kind of situations can make the Callbacks quite messy IMHO. If you can separate some of the inputs and outputs from the rest do so. For example if the graph1 only depends on the change of some components, create a separate callback for this graph1.
Otherwise you would have to write one callback for all graphs with all inputs and differentiate which component has triggered the callback. Have a look here: