Prioritize callbacks and order of completion


I have two drop downs (A and B).
A updates a Graph and B decides if you want a sub-group, and also updates the graph after selection.
I have also implemented a datatable where the user can select a row that updates the two dropdowns with the row data. By updating the dropdowns they automatically updates the graph.

The problem i now have is that if a value is selected in B and a row is selected in the datatable which does not contain the already selected sub group value in B I get an error.

The callback first update A that tries to update the graph but if B is not included in the set i get an error,

Now it updates in this order:
Row Selection --> Dropdown A (+ old B value) --> Graph --> Error --> Dropdown B
But i need it to update the two dropdowns before the dropdowns update the graph:
Row selection --> A --> B --> Graph

Is this possible to add a condition that the datatable callback is prioritized and other callbacks will only update after completion?

You will need to add Code. Thx

I hope this helps illustrate the code

import dash
import dash_table
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State

app.layout = html.Div([
                   dcc.Dropdown(id='DropdownA', etc...),
                   dcc.Dropdown(id='DropdownB', etc...),


#Updates a graph depeniding on A or A and B

    def update_MAINfigure(A,B):

     return fig

#selected row and take respective column data to update dropdown values

def update_Dropdowns(row_pick,data,old_A,old_B):
       if row_pick:

           return A,B
           return old_A,old_B