private async Task <object> ResolveConnectionAsync(IMediator mediator, IResolveConnectionContext <object> context)
        {
            var first = context.First;
            var skip  = Convert.ToInt32(context.After ?? 0.ToString());

            var query = context.GetCartQuery <SearchCartQuery>();

            query.Skip          = skip;
            query.Take          = first ?? context.PageSize ?? 10;
            query.Sort          = context.GetArgument <string>("sort");
            query.Filter        = context.GetArgument <string>("filter");
            query.IncludeFields = context.SubFields.Values.GetAllNodesPaths().ToArray();

            context.CopyArgumentsToUserContext();

            var authorizationResult = await _authorizationService.AuthorizeAsync(context.GetCurrentPrincipal(), query, new CanAccessCartAuthorizationRequirement());

            if (!authorizationResult.Succeeded)
            {
                throw new ExecutionError($"Access denied");
            }

            var response = await mediator.Send(query);

            foreach (var cartAggregate in response.Results)
            {
                context.SetExpandedObjectGraph(cartAggregate);
            }
            return(new PagedConnection <CartAggregate>(response.Results, skip, Convert.ToInt32(context.After ?? 0.ToString()), response.TotalCount));
        }