Skip to content

Commit 4d78ee6

Browse files
fix: Change organization field to ExtendableFieldAsync in ExtendableFieldAsync in ContactType (#127)
1 parent 238ba87 commit 4d78ee6

File tree

1 file changed

+11
-14
lines changed
  • src/VirtoCommerce.ProfileExperienceApiModule.Data/Schemas

1 file changed

+11
-14
lines changed

src/VirtoCommerce.ProfileExperienceApiModule.Data/Schemas/ContactType.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,18 @@ public ContactType(
6666
Field<StringGraphType>("organizationId")
6767
.ResolveAsync(async context => await GetCurrentOrganizationId(context));
6868

69-
Field<OrganizationType>("organization")
70-
.ResolveAsync(async context =>
69+
ExtendableFieldAsync<OrganizationType>("organization", resolve: async context => {
70+
var organizationId = await GetCurrentOrganizationId(context);
71+
if (organizationId.IsNullOrEmpty())
72+
{
73+
return null;
74+
}
75+
var query = new GetOrganizationByIdQuery()
7176
{
72-
var organizationId = await GetCurrentOrganizationId(context);
73-
if (organizationId.IsNullOrEmpty())
74-
{
75-
return null;
76-
}
77-
78-
var query = new GetOrganizationByIdQuery()
79-
{
80-
Id = organizationId,
81-
};
82-
return await mediator.Send(query);
83-
});
77+
Id = organizationId,
78+
};
79+
return await mediator.Send(query);
80+
});
8481

8582
Field<StringGraphType>("selectedAddressId")
8683
.Description("Selected shipping address id.")

0 commit comments

Comments
 (0)