Repository: hasura/graphql-engine
File: console/src/components/Services/Data/DataActions.js (JavaScript)

Code before:
      }
      dispatch(updateSchemaInfo());
    }
    if (successMsg) {
      dispatch(showSuccessNotification(successMsg));
    }
    customOnSuccess(data, globals.consoleMode, currMigrationMode);
  };
  const retryMigration = (err = {}, errMsg = '') => {
    dispatch(
      showNotification({
        title: errMsg,
        level: 'error',
        message: (
          <p>
            {getErrorMessage(err, '')}
            <br />
            <br />
            Do you want to drop the dependent items as well?
          </p>
        ),
        autoDismiss: 0,
        action: {
          label: 'Continue',
          callback: () =>
            makeMigrationCall(
              dispatch,
              getState,
              cascadeUpQueries(upQueries), // cascaded new up queries
              downQueries,
              migrationName,
              customOnSuccess,
              customOnError,
              requestMsg,
              successMsg,
              errorMsg,
              shouldSkipSchemaReload,
              true // prevent further retry
            ),
        },
      })
    );
  };

  const onError = err => {
    if (!isRetry && err.code == 'dependency-error') {
      retryMigration(err, errorMsg);
    } else if (!isRetry && err.code == 'data_api_error') {
      const actualError = JSON.parse(err.message);
      if (actualError.code == 'dependency-error') {
        retryMigration(

Review comment (suggestion):
We can start thinking about using object for `makeMigrationCall` args. We could then have:
```js
const retryMigration = (/* */, args) => { ... }   // <- move outside

const makeMigrationCall = (args) => {
 const { ... } = args;
 
 // don't worry about creating retryMigration

  const onError = () => {
   ...
  retryMigration(allNeededArgs, args)
  }
  ...
}
```
Not necessary to do in this PR. Just a thought. 

Code after:
        dispatch(loadMigrationStatus()); // don't call for server mode
      }
      dispatch(updateSchemaInfo());
    }
    if (successMsg) {
      dispatch(showSuccessNotification(successMsg));
    }
    customOnSuccess(data, globals.consoleMode, currMigrationMode);
  };
  const retryMigration = (err = {}, errMsg = '') => {
    dispatch(
      showNotification(
        {
          title: errMsg,
          level: 'error',
          message: (
            <p>
              {getErrorMessage('', err)}
              <br />
              <br />
              Do you want to drop the dependent items as well?
            </p>
          ),
          autoDismiss: 0,
          action: {
            label: 'Continue',
            callback: () =>
              makeMigrationCall(
                dispatch,
                getState,
                cascadeUpQueries(upQueries), // cascaded new up queries
                downQueries,
                migrationName,
                customOnSuccess,
                customOnError,
                requestMsg,
                successMsg,
                errorMsg,
                shouldSkipSchemaReload,
                true // prevent further retry
              ),
          },
        },
        'error'
      )
    );
  };

  const onError = err => {
    if (!isRetry) {
      const dependecyError = getDependencyError(err);