Skip to content

Commit 3a6fa4e

Browse files
committed
GraphQL - product type of type enum added
1 parent 0c4cbcf commit 3a6fa4e

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CarvedRock/CarvedRock.Api/GraphQL/Types/ProductType.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ public ProductType()
1010
Field(t => t.Id);
1111
Field(t => t.Name);
1212
Field(t => t.Description);
13+
Field(t => t.IntroducedAt).Description("When the product was first introduced in the catalog");
14+
Field(t => t.PhotoFileName).Description("The file name of the photo so the client can render it");
15+
Field(t => t.Price);
16+
Field(t => t.Rating).Description("The (max 5) star customer rating");
17+
Field(t => t.Stock);
18+
Field<ProductTypeEnumType>("Type", "The type of product");
1319
}
1420
}
1521
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using CarvedRock.Api.Data;
2+
using GraphQL.Types;
3+
4+
namespace CarvedRock.Api.GraphQL.Types
5+
{
6+
public class ProductTypeEnumType : EnumerationGraphType<ProductTypeEnum>
7+
{
8+
public ProductTypeEnumType()
9+
{
10+
Name = "Type";
11+
Description = "The type of product";
12+
}
13+
}
14+
}

0 commit comments

Comments
 (0)