private string GetErrorMessage <T>(QueryResultBase <T> queryResult, string requestId)
        {
            var error = queryResult?.Errors?.FirstOrDefault();

            if (error != null)
            {
                _logger.LogDebug("The request {requestId} failed because: {message} [{code}]", requestId, error.Message, error.Code);
                return($"{error.Message} [{error.Code}]");
            }

            return(string.Empty);
        }
        private string GetErrorMessage <T>(QueryResultBase <T> queryResult, string requestId, HttpStatusCode statusCodeFallback)
        {
            var error = queryResult?.Errors?.FirstOrDefault();

            if (error != null)
            {
                _logger.LogDebug("The request {requestId} failed because: {message} [{code}]", requestId, error.Message, error.Code);
                return($"{error.Message} [{error.Code}]");
            }

            _logger.LogDebug($"The request {{requestId}} failed for an unknown reason with HTTP {(int)statusCodeFallback}", requestId, statusCodeFallback);
            return($"HTTP {(int)statusCodeFallback}");
        }