Skip to content

Commit 726b7d3

Browse files
committed
Regenrate clients
1 parent 0965336 commit 726b7d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2543
-1676
lines changed

src/Linq2GraphQL.Generator/GraphQLSchema/Helpers.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,17 +111,18 @@ internal static string SafeVariableName(string name)
111111
{ "Float", new ValueTuple<string, Type>("double", typeof(double)) },
112112
{ "String", new ValueTuple<string, Type>("string", typeof(string)) },
113113
{ "Date", new ValueTuple<string, Type>("DateTime", typeof(DateTime)) },
114-
{ "LocalDate", new ValueTuple<string, Type>("DateOnly", typeof(DateOnly)) },
115114
{ "Boolean", new ValueTuple<string, Type>("bool", typeof(bool)) },
116115
{ "Long", new ValueTuple<string, Type>("long", typeof(long)) },
117116
{ "uuid", new ValueTuple<string, Type>("Guid", typeof(Guid)) },
118117
{ "timestamptz", new ValueTuple<string, Type>("DateTimeOffset", typeof(DateTimeOffset)) },
119118
{ "Uri", new ValueTuple<string, Type>("Uri", typeof(Uri)) },
120119
{ "DateTime", new ValueTuple<string, Type>("DateTimeOffset", typeof(DateTimeOffset)) },
121-
{ "LocalTime", new ValueTuple<string, Type>("TimeOnly", typeof(TimeOnly)) },
122120
{ "Decimal", new ValueTuple<string, Type>("decimal", typeof(decimal)) },
123121
{ "TimeSpan", new ValueTuple<string, Type>("TimeSpan", typeof(TimeSpan)) },
124122
{ "Byte", new ValueTuple<string, Type>("byte", typeof(byte)) },
123+
124+
{ "LocalDate", new ValueTuple<string, Type>("DateTime", typeof(DateTime)) },
125+
{ "LocalTime", new ValueTuple<string, Type>("TimeSpan", typeof(TimeSpan)) },
125126
};
126127

127128

src/Linq2GraphQL.Generator/Properties/launchSettings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"profiles": {
33
"Linq2GraphQL.Generator": {
44
"commandName": "Project",
5-
"commandLineArgs": "https://localhost:7184/graphql/ -c=\"SampleClient\" -n=\"Linq2GraphQL.TestClient\" -o=\"C:\\Code\\Github\\Linq2GraphQL.Client\\test\\Linq2GraphQL.TestClient\\Generated\" -s=true -d=true"
5+
"commandLineArgs": "https://localhost:7184/graphql/ -c=\"SampleClient\" -n=\"Linq2GraphQL.TestClient\" -o=\"C:\\Code\\Linq2GraphQL.Client\\test\\Linq2GraphQL.TestClient\\Generated\" -s=true -d=true"
6+
// "commandLineArgs": "https://localhost:50741/graphql/ -c=\"SampleNullableClient\" -n=\"Linq2GraphQL.TestClientNullable\" -o=\"C:\\Code\\Linq2GraphQL.Client\\test\\Linq2GraphQL.TestClientNullable\\Generated\" -s=true -d=true -nu=true"
67
}
78
}
89
}

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,19 @@ public GraphCursorQuery<AnimalsConnection> Animals(int? first = null, string aft
106106
return new GraphCursorQuery<AnimalsConnection>(client, "animals", OperationType.Query, arguments);
107107
}
108108

109-
public GraphQuery<OrdersOffsetPagingCollectionSegment> OrdersOffsetPaging(int? skip = null, int? take = null, OrderFilterInput where = null, List<OrderSortInput> order = null)
109+
public GraphCursorQuery<OrdersOffsetPagingConnection> OrdersOffsetPaging(int? first = null, string after = null, int? last = null, string before = null, OrderFilterInput where = null, List<OrderSortInput> order = null)
110110
{
111111
var arguments = new List<ArgumentValue>
112112
{
113-
new("skip","Int", skip),
114-
new("take","Int", take),
113+
new("first","Int", first),
114+
new("after","String", after),
115+
new("last","Int", last),
116+
new("before","String", before),
115117
new("where","OrderFilterInput", where),
116118
new("order","[OrderSortInput!]", order),
117119
};
118120

119-
return new GraphQuery<OrdersOffsetPagingCollectionSegment>(client, "ordersOffsetPaging", OperationType.Query, arguments);
121+
return new GraphCursorQuery<OrdersOffsetPagingConnection>(client, "ordersOffsetPaging", OperationType.Query, arguments);
120122
}
121123

122124
}

test/Linq2GraphQL.TestClient/Generated/Client/SampleClient.cs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,53 @@
66
//---------------------------------------------------------------------
77

88
using Linq2GraphQL.Client;
9-
using Microsoft.Extensions.Caching.Memory;
109
using Microsoft.Extensions.DependencyInjection;
1110
using Microsoft.Extensions.Options;
1211

1312
namespace Linq2GraphQL.TestClient;
1413

14+
/// <summary>
15+
/// GraphQL client for SampleClient operations
16+
/// </summary>
17+
/// <remarks>
18+
/// Provides strongly-typed access to GraphQL queries, mutations, and subscriptions.
19+
/// Supports dependency injection for better testability and flexibility.
20+
/// </remarks>
1521
public class SampleClient : ISampleClient
1622
{
17-
public SampleClient(HttpClient httpClient, [FromKeyedServices("SampleClient")]IOptions<GraphClientOptions> options, IServiceProvider provider)
23+
/// <summary>
24+
/// Constructor with dependency injection support
25+
/// </summary>
26+
/// <param name="httpClient">HTTP client for GraphQL requests</param>
27+
/// <param name="options">GraphQL client configuration options</param>
28+
/// <param name="provider">Service provider for dependency resolution</param>
29+
/// <param name="queryMethods">Optional query methods implementation (uses default if null)</param>
30+
/// <param name="mutationMethods">Optional mutation methods implementation (uses default if null)</param>
31+
/// <param name="subscriptionMethods">Optional subscription methods implementation (uses default if null)</param>
32+
public SampleClient(
33+
HttpClient httpClient,
34+
[FromKeyedServices("SampleClient")] IOptions<GraphClientOptions> options,
35+
IServiceProvider provider,
36+
IQueryMethods queryMethods = null,
37+
IMutationMethods mutationMethods = null,
38+
ISubscriptionMethods subscriptionMethods = null)
1839
{
1940
var client = new GraphClient(httpClient, options, provider, true);
20-
Query = new QueryMethods(client);
21-
Mutation = new MutationMethods(client);
22-
Subscription = new SubscriptionMethods(client);
41+
Query = queryMethods ?? new QueryMethods(client);
42+
Mutation = mutationMethods ?? new MutationMethods(client);
43+
Subscription = subscriptionMethods ?? new SubscriptionMethods(client);
2344
}
2445

46+
/// <summary>
47+
/// Gets the query methods for this GraphQL client
48+
/// </summary>
2549
public IQueryMethods Query { get; private set; }
50+
/// <summary>
51+
/// Gets the mutation methods for this GraphQL client
52+
/// </summary>
2653
public IMutationMethods Mutation { get; private set; }
54+
/// <summary>
55+
/// Gets the subscription methods for this GraphQL client
56+
/// </summary>
2757
public ISubscriptionMethods Subscription { get; private set; }
28-
2958
}

test/Linq2GraphQL.TestClient/Generated/Client/SampleClientExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private static IGraphClientBuilder<SampleClient> GraphClientBuilder(IServiceColl
3333
GraphClientOptions graphClientOptions)
3434
{
3535
var opts = Options.Create(graphClientOptions);
36-
services.AddKeyedSingleton(ClientName, opts);
36+
services.AddKeyedSingleton(ClientName, opts);
3737
services.AddMemoryCache();
3838
return new ClientBuilder<SampleClient>(ClientName, services);
3939
}

test/Linq2GraphQL.TestClient/Generated/Inputs/AddressFilterInput.cs

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,62 @@
55
// Url: https://linq2graphql.com
66
//---------------------------------------------------------------------
77

8+
using System;
9+
using System.Collections.Generic;
810
using System.Text.Json.Serialization;
911
using Linq2GraphQL.Client;
1012

1113
namespace Linq2GraphQL.TestClient;
1214

1315
[JsonConverter(typeof(GraphInputConverter<AddressFilterInput>))]
14-
public class AddressFilterInput : GraphInputBase
16+
public partial class AddressFilterInput : GraphInputBase
1517
{
16-
[GraphQLMember("and")]
17-
[JsonPropertyName("and")]
18-
public List<AddressFilterInput> And
19-
{
20-
get => GetValue<List<AddressFilterInput>>("and");
21-
set => SetValue("and", value);
22-
}
23-
24-
[GraphQLMember("or")]
25-
[JsonPropertyName("or")]
26-
public List<AddressFilterInput> Or
27-
{
28-
get => GetValue<List<AddressFilterInput>>("or");
29-
set => SetValue("or", value);
30-
}
31-
32-
[GraphQLMember("name")]
33-
[JsonPropertyName("name")]
34-
public StringOperationFilterInput Name
35-
{
36-
get => GetValue<StringOperationFilterInput>("name");
37-
set => SetValue("name", value);
38-
}
39-
40-
[GraphQLMember("street")]
41-
[JsonPropertyName("street")]
42-
public StringOperationFilterInput Street
43-
{
44-
get => GetValue<StringOperationFilterInput>("street");
45-
set => SetValue("street", value);
46-
}
47-
48-
[GraphQLMember("postalCode")]
49-
[JsonPropertyName("postalCode")]
50-
public StringOperationFilterInput PostalCode
51-
{
52-
get => GetValue<StringOperationFilterInput>("postalCode");
53-
set => SetValue("postalCode", value);
54-
}
18+
[GraphQLMember("and")]
19+
[JsonPropertyName("and")]
20+
public List<AddressFilterInput> And
21+
{
22+
get => GetValue<List<AddressFilterInput>>("and");
23+
set => SetValue("and", value);
24+
}
25+
26+
[GraphQLMember("or")]
27+
[JsonPropertyName("or")]
28+
public List<AddressFilterInput> Or
29+
{
30+
get => GetValue<List<AddressFilterInput>>("or");
31+
set => SetValue("or", value);
32+
}
33+
34+
[GraphQLMember("name")]
35+
[JsonPropertyName("name")]
36+
public StringOperationFilterInput Name
37+
{
38+
get => GetValue<StringOperationFilterInput>("name");
39+
set => SetValue("name", value);
40+
}
41+
42+
[GraphQLMember("street")]
43+
[JsonPropertyName("street")]
44+
public StringOperationFilterInput Street
45+
{
46+
get => GetValue<StringOperationFilterInput>("street");
47+
set => SetValue("street", value);
48+
}
49+
50+
[GraphQLMember("postalCode")]
51+
[JsonPropertyName("postalCode")]
52+
public StringOperationFilterInput PostalCode
53+
{
54+
get => GetValue<StringOperationFilterInput>("postalCode");
55+
set => SetValue("postalCode", value);
56+
}
57+
58+
[GraphQLMember("createdDate")]
59+
[JsonPropertyName("createdDate")]
60+
public LocalDateOperationFilterInput CreatedDate
61+
{
62+
get => GetValue<LocalDateOperationFilterInput>("createdDate");
63+
set => SetValue("createdDate", value);
64+
}
65+
5566
}

test/Linq2GraphQL.TestClient/Generated/Inputs/AddressInput.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,12 @@ public string PostalCode
3939
set => SetValue("postalCode", value);
4040
}
4141

42+
[GraphQLMember("createdDate")]
43+
[JsonPropertyName("createdDate")]
44+
public DateTime CreatedDate
45+
{
46+
get => GetValue<DateTime>("createdDate");
47+
set => SetValue("createdDate", value);
48+
}
49+
4250
}

test/Linq2GraphQL.TestClient/Generated/Inputs/AddressSortInput.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,12 @@ public SortEnumType? PostalCode
3939
set => SetValue("postalCode", value);
4040
}
4141

42+
[GraphQLMember("createdDate")]
43+
[JsonPropertyName("createdDate")]
44+
public SortEnumType? CreatedDate
45+
{
46+
get => GetValue<SortEnumType?>("createdDate");
47+
set => SetValue("createdDate", value);
48+
}
49+
4250
}

0 commit comments

Comments
 (0)