From fa4391eb0d139391f1107a28106089b18d142b54 Mon Sep 17 00:00:00 2001 From: Hyun Seungmin Date: Fri, 27 Sep 2024 20:05:17 +0900 Subject: [PATCH] add "products" GraphQL query --- Mimir/GraphQL/Types/QueryType.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Mimir/GraphQL/Types/QueryType.cs b/Mimir/GraphQL/Types/QueryType.cs index 5cc53154..e2e592a4 100644 --- a/Mimir/GraphQL/Types/QueryType.cs +++ b/Mimir/GraphQL/Types/QueryType.cs @@ -1,8 +1,17 @@ using Mimir.GraphQL.Queries; +using Mimir.GraphQL.Types.MimirBsonDocuments; +using Mimir.Repositories; namespace Mimir.GraphQL.Types; public class QueryType : ObjectType { - protected override void Configure(IObjectTypeDescriptor descriptor) { } + protected override void Configure(IObjectTypeDescriptor descriptor) + { + descriptor + .Field("products") + .Description("Retrieves a list of market products.") + .UseOffsetPaging() + .Resolve(context => context.Service().GetAll()); + } }