Fix console app graphQL queries
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -38,6 +38,8 @@ func (r *identityResolver) Profiles(ctx context.Context, obj *types.Identity, fi
|
||||
return nil, err
|
||||
}
|
||||
|
||||
filter := coredata.NewMembershipProfileFilter(nil)
|
||||
|
||||
if gqlutils.OnlyTotalCountSelected(ctx) {
|
||||
return &types.ProfileConnection{
|
||||
Resolver: r,
|
||||
@@ -45,8 +47,6 @@ func (r *identityResolver) Profiles(ctx context.Context, obj *types.Identity, fi
|
||||
}, nil
|
||||
}
|
||||
|
||||
filter := coredata.NewMembershipProfileFilter(nil)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MembershipProfileOrderField]{
|
||||
Field: coredata.MembershipProfileOrderFieldFullName,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
@@ -1247,6 +1247,8 @@ func (r *organizationResolver) Profiles(ctx context.Context, obj *types.Organiza
|
||||
return nil, err
|
||||
}
|
||||
|
||||
filter := coredata.NewMembershipProfileFilter(nil)
|
||||
|
||||
if gqlutils.OnlyTotalCountSelected(ctx) {
|
||||
return &types.ProfileConnection{
|
||||
Resolver: r,
|
||||
@@ -1254,8 +1256,6 @@ func (r *organizationResolver) Profiles(ctx context.Context, obj *types.Organiza
|
||||
}, nil
|
||||
}
|
||||
|
||||
filter := coredata.NewMembershipProfileFilter(nil)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MembershipProfileOrderField]{
|
||||
Field: coredata.MembershipProfileOrderFieldFullName,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
@@ -1514,7 +1514,7 @@ func (r *profileConnectionResolver) TotalCount(ctx context.Context, obj *types.P
|
||||
case *identityResolver:
|
||||
count, err := r.iam.AccountService.CountProfiles(ctx, obj.ParentID, coredata.NewMembershipProfileFilter(nil))
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot count sprofiles", log.Error(err))
|
||||
r.logger.ErrorCtx(ctx, "cannot count profiles", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
return &count, nil
|
||||
|
||||
@@ -6576,7 +6576,7 @@ func (r *profileConnectionResolver) TotalCount(ctx context.Context, obj *types.P
|
||||
}
|
||||
|
||||
switch obj.Resolver.(type) {
|
||||
case *stateOfApplicabilityResolver:
|
||||
case *organizationResolver:
|
||||
count, err := r.iam.OrganizationService.CountProfiles(ctx, obj.ParentID, obj.Filters)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot count profiles: %w", err))
|
||||
|
||||
Reference in New Issue
Block a user