Skip to content

Commit b3da330

Browse files
committed
Updated Nullable client
1 parent aa2a81f commit b3da330

7 files changed

Lines changed: 23 additions & 8 deletions

File tree

src/Linq2GraphQL.Generator/Properties/launchSettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"profiles": {
33
"Linq2GraphQL.Generator": {
44
"commandName": "Project",
5-
"commandLineArgs": "https://localhost:50741/graphql/ -c=\"SampleClient\" -n=\"Linq2GraphQL.TestClient\" -o=\"C:\\Temp\\Linq2GraphQL\\nullable\\Linq2GraphQL.TestClient\\Generated\" -s=true -es=\"AddUnknownOption\" -nu=true"
5+
"commandLineArgs": "https://localhost:50741/graphql/ -c=\"SampleNullableClient\" -n=\"Linq2GraphQL.TestClientNullable\" -o=\"C:\\temp\\Linq2GraphQL\\Linq2GraphQL.TestClientNullable\\Generated\" -s=true -nu=true"
66
}
77
}
88
}

test/Linq2GraphQL.TestClientNullable/Generated/Client/QueryMethods.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public GraphQuery<List<Customer>> CustomerList()
2222
return new GraphQuery<List<Customer>>(client, "customerList", OperationType.Query, arguments);
2323
}
2424

25-
public GraphQuery<Customer> CustomerNullable()
25+
public GraphQuery<Customer?> CustomerNullable()
2626
{
2727
var arguments = new List<ArgumentValue>
2828
{
2929
};
3030

31-
return new GraphQuery<Customer>(client, "customerNullable", OperationType.Query, arguments);
31+
return new GraphQuery<Customer?>(client, "customerNullable", OperationType.Query, arguments);
3232
}
3333

3434
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text.Json.Serialization;
4+
using Linq2GraphQL.Client;
5+
6+
namespace Linq2GraphQL.TestClientNullable;
7+
8+
//public static class IF
9+
//{
10+
//}
11+
12+

test/Linq2GraphQL.TestClientNullable/Generated/Types/Customer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ public partial class Customer : GraphQLTypeBase
2121
public List<Order> Orders { get; set; }
2222

2323
[JsonPropertyName("address")]
24-
public Address Address { get; set; }
24+
public Address? Address { get; set; }
2525

2626
}

test/Linq2GraphQL.TestClientNullable/Generated/Types/Order.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ public partial class Order : GraphQLTypeBase
4545
public Customer Customer { get; set; }
4646

4747
[JsonPropertyName("address")]
48-
public Address Address { get; set; }
48+
public Address? Address { get; set; }
4949

5050
[JsonPropertyName("orderDate")]
5151
public DateTimeOffset OrderDate { get; set; }
5252

5353
[JsonPropertyName("lines")]
5454
public List<OrderLine> Lines { get; set; }
5555

56+
[JsonPropertyName("entryTime")]
57+
public TimeSpan? EntryTime { get; set; }
58+
5659
}

test/Linq2GraphQL.TestClientNullable/Generated/Types/OrderLine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ public partial class OrderLine : GraphQLTypeBase
1515
public Order Order { get; set; }
1616

1717
[JsonPropertyName("item")]
18-
public Item Item { get; set; }
18+
public Item? Item { get; set; }
1919

2020
[JsonPropertyName("price")]
2121
public decimal Price { get; set; }
2222

2323
[JsonPropertyName("quantity")]
24-
public float Quantity { get; set; }
24+
public double Quantity { get; set; }
2525

2626
}

test/Linq2GraphQL.TestClientNullable/Linq2GraphQL.TestClientNullable.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>disable</Nullable>
6+
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

99
<ItemGroup>

0 commit comments

Comments
 (0)