public async Task Invoke(HttpContext context)
        {
            _logger.LogDebug("started calling query string builder middleware");

            if (DownstreamRoute.ReRoute.ClaimsToQueries.Any())
            {
                _logger.LogDebug("this route has instructions to convert claims to queries");

                var response = _addQueriesToRequest.SetQueriesOnDownstreamRequest(DownstreamRoute.ReRoute.ClaimsToQueries, context.User.Claims, DownstreamRequest);

                if (response.IsError)
                {
                    _logger.LogDebug("there was an error setting queries on context, setting pipeline error");

                    SetPipelineError(response.Errors);
                    return;
                }
            }

            _logger.LogDebug("calling next middleware");

            await _next.Invoke(context);

            _logger.LogDebug("succesfully called next middleware");
        }
        public async Task Invoke(DownstreamContext context)
        {
            if (context.DownstreamReRoute.ClaimsToQueries.Any())
            {
                Logger.LogInformation($"{context.DownstreamReRoute.DownstreamPathTemplate.Value} has instructions to convert claims to queries");

                var response = _addQueriesToRequest.SetQueriesOnDownstreamRequest(context.DownstreamReRoute.ClaimsToQueries, context.HttpContext.User.Claims, context.DownstreamRequest);

                if (response.IsError)
                {
                    Logger.LogWarning("there was an error setting queries on context, setting pipeline error");

                    SetPipelineError(context, response.Errors);
                    return;
                }
            }

            await _next.Invoke(context);
        }
        public async Task Invoke(HttpContext httpContext)
        {
            var downstreamRoute = httpContext.Items.DownstreamRoute();

            if (downstreamRoute.ClaimsToQueries.Any())
            {
                Logger.LogInformation($"{downstreamRoute.DownstreamPathTemplate.Value} has instructions to convert claims to queries");

                var downstreamRequest = httpContext.Items.DownstreamRequest();

                var response = _addQueriesToRequest.SetQueriesOnDownstreamRequest(downstreamRoute.ClaimsToQueries, httpContext.User.Claims, downstreamRequest);

                if (response.IsError)
                {
                    Logger.LogWarning("there was an error setting queries on context, setting pipeline error");

                    httpContext.Items.UpsertErrors(response.Errors);
                    return;
                }
            }

            await _next.Invoke(httpContext);
        }