Skip to content

Commit

Permalink
feat: Make graph types extendable (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyshibanov authored Sep 13, 2024
1 parent 074f0f2 commit 167964b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using GraphQL.Types;
using VirtoCommerce.Xapi.Core.Schemas;
using VirtoCommerce.XCatalog.Core.Schemas;
using VirtoCommerce.XRecommend.Core.Models;

namespace VirtoCommerce.XRecommend.Core.Schemas;

public class GetRecentlyBrowsedResponseType : ObjectGraphType<GetRecentlyBrowsedResult>
public class GetRecentlyBrowsedResponseType : ExtendableGraphType<GetRecentlyBrowsedResult>
{
public GetRecentlyBrowsedResponseType()
{
Field<ListGraphType<ProductType>>("products", resolve: context => context.Source.Products);
ExtendableField<ListGraphType<ProductType>>("products", resolve: context => context.Source.Products);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using GraphQL.Types;
using VirtoCommerce.Xapi.Core.Schemas;
using VirtoCommerce.XCatalog.Core.Schemas;
using VirtoCommerce.XRecommend.Core.Models;

namespace VirtoCommerce.XRecommend.Core.Schemas;

public class GetRecommendationsResponseType : ObjectGraphType<GetRecommendationsResult>
public class GetRecommendationsResponseType : ExtendableGraphType<GetRecommendationsResult>
{
public GetRecommendationsResponseType()
{
Field<ListGraphType<ProductType>>("products", resolve: context => context.Source.Products);
ExtendableField<ListGraphType<ProductType>>("products", resolve: context => context.Source.Products);
}
}

0 comments on commit 167964b

Please sign in to comment.