Skip to content

Commit 0be3473

Browse files
committed
working mutation and query for CustomerManagementAPI
1 parent d747d5b commit 0be3473

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/CustomerManagementAPI.Host/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"authorities": [
1515
{
1616
"scheme": "self",
17-
"authority": "https://localhost:5001",
17+
"authority": "https://graphqlplay22.azurewebsites.net",
1818
"additionalEndpointBaseAddresses": [
1919
]
2020
}

src/CustomerManagementAPI/Models/CustomerType.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ public CustomerType()
1010
Name = "customer";
1111
Field<StringGraphType>("Id", "The id of the customer");
1212
Field<StringGraphType>("name", "The name of the customer");
13-
13+
Field<StringGraphType>("address", "The address of the customer");
14+
Field<StringGraphType>("postalCode", "The postalCode of the customer");
15+
Field<StringGraphType>("city", "The city of the customer");
16+
Field<StringGraphType>("telephoneNumber", "The telephoneNumber of the customer");
17+
Field<StringGraphType>("emailAddress", "The emailAddress of the customer");
1418
}
1519
}
1620
}

src/CustomerManagementAPI/Mutation/CustomerManagementMutation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public void AddGraphTypeFields(MutationCore mutationCore)
2020
{
2121
mutationCore.FieldAsync<CustomerType>(name: "upsertCustomer",
2222
description: null,
23-
arguments: new QueryArguments(new QueryArgument<NonNullGraphType<CustomerCreateInputType>> { Name = "customer" }),
23+
arguments: new QueryArguments(new QueryArgument<NonNullGraphType<CustomerCreateInputType>> { Name = "input" }),
2424
resolve: async context =>
2525
{
2626

27-
var input = context.GetArgument<CustomerCreateInput>("customer");
27+
var input = context.GetArgument<CustomerCreateInput>("input");
2828
var customer = new CustomerManagementStore.Model.Customer
2929
{
3030
Id = input.Id,

0 commit comments

Comments
 (0)