Skip to content

Commit 39ed5b7

Browse files
authored
Merge pull request #30 from Linq2GraphQL/multiple-methods
Multiple methods
2 parents 68e91b7 + e719266 commit 39ed5b7

85 files changed

Lines changed: 1281 additions & 493 deletions

File tree

Some content is hidden

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

docs/StarWars.Client/Generated/Types/Film.cs

Lines changed: 53 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

@@ -10,100 +11,127 @@ public static class FilmExtensions
1011
[GraphMethod("speciesConnection")]
1112
public static FilmSpeciesConnection SpeciesConnection(this Film film, [GraphArgument("String")] string after = null, [GraphArgument("Int")] int? first = null, [GraphArgument("String")] string before = null, [GraphArgument("Int")] int? last = null)
1213
{
13-
return film?.SpeciesConnection;
14+
return film.GetMethodValue<FilmSpeciesConnection>("speciesConnection", after, first, before, last);
1415
}
1516

1617
[GraphMethod("starshipConnection")]
1718
public static FilmStarshipsConnection StarshipConnection(this Film film, [GraphArgument("String")] string after = null, [GraphArgument("Int")] int? first = null, [GraphArgument("String")] string before = null, [GraphArgument("Int")] int? last = null)
1819
{
19-
return film?.StarshipConnection;
20+
return film.GetMethodValue<FilmStarshipsConnection>("starshipConnection", after, first, before, last);
2021
}
2122

2223
[GraphMethod("vehicleConnection")]
2324
public static FilmVehiclesConnection VehicleConnection(this Film film, [GraphArgument("String")] string after = null, [GraphArgument("Int")] int? first = null, [GraphArgument("String")] string before = null, [GraphArgument("Int")] int? last = null)
2425
{
25-
return film?.VehicleConnection;
26+
return film.GetMethodValue<FilmVehiclesConnection>("vehicleConnection", after, first, before, last);
2627
}
2728

2829
[GraphMethod("characterConnection")]
2930
public static FilmCharactersConnection CharacterConnection(this Film film, [GraphArgument("String")] string after = null, [GraphArgument("Int")] int? first = null, [GraphArgument("String")] string before = null, [GraphArgument("Int")] int? last = null)
3031
{
31-
return film?.CharacterConnection;
32+
return film.GetMethodValue<FilmCharactersConnection>("characterConnection", after, first, before, last);
3233
}
3334

3435
[GraphMethod("planetConnection")]
3536
public static FilmPlanetsConnection PlanetConnection(this Film film, [GraphArgument("String")] string after = null, [GraphArgument("Int")] int? first = null, [GraphArgument("String")] string before = null, [GraphArgument("Int")] int? last = null)
3637
{
37-
return film?.PlanetConnection;
38+
return film.GetMethodValue<FilmPlanetsConnection>("planetConnection", after, first, before, last);
3839
}
3940

4041
}
4142

42-
public partial class Film : Node
43+
public partial class Film : GraphQLTypeBase, Node
4344
{
44-
[JsonPropertyName("title")]
45+
[JsonPropertyName("title")]
4546
public string Title { get; set; }
4647

47-
[JsonPropertyName("episodeID")]
48+
49+
[JsonPropertyName("episodeID")]
4850
public int? EpisodeID { get; set; }
4951

50-
[JsonPropertyName("openingCrawl")]
52+
53+
[JsonPropertyName("openingCrawl")]
5154
public string OpeningCrawl { get; set; }
5255

53-
[JsonPropertyName("director")]
56+
57+
[JsonPropertyName("director")]
5458
public string Director { get; set; }
5559

56-
[JsonPropertyName("producers")]
60+
61+
[JsonPropertyName("producers")]
5762
public List<string> Producers { get; set; }
5863

59-
[JsonPropertyName("releaseDate")]
64+
65+
[JsonPropertyName("releaseDate")]
6066
public string ReleaseDate { get; set; }
6167

68+
69+
70+
private LazyProperty<FilmSpeciesConnection> _speciesConnection = new();
6271
/// <summary>
6372
/// Do not use in Query, only to retrive result
6473
/// </summary>
6574
[GraphShadowProperty]
66-
[JsonPropertyName("speciesConnection")]
67-
public FilmSpeciesConnection SpeciesConnection { get; set; }
75+
public FilmSpeciesConnection SpeciesConnection => _speciesConnection.Value(() => GetFirstMethodValue<FilmSpeciesConnection>("speciesConnection"));
76+
// public FilmSpeciesConnection SpeciesConnection { get; set; }
77+
78+
6879

80+
private LazyProperty<FilmStarshipsConnection> _starshipConnection = new();
6981
/// <summary>
7082
/// Do not use in Query, only to retrive result
7183
/// </summary>
7284
[GraphShadowProperty]
73-
[JsonPropertyName("starshipConnection")]
74-
public FilmStarshipsConnection StarshipConnection { get; set; }
85+
public FilmStarshipsConnection StarshipConnection => _starshipConnection.Value(() => GetFirstMethodValue<FilmStarshipsConnection>("starshipConnection"));
86+
// public FilmStarshipsConnection StarshipConnection { get; set; }
87+
88+
7589

90+
private LazyProperty<FilmVehiclesConnection> _vehicleConnection = new();
7691
/// <summary>
7792
/// Do not use in Query, only to retrive result
7893
/// </summary>
7994
[GraphShadowProperty]
80-
[JsonPropertyName("vehicleConnection")]
81-
public FilmVehiclesConnection VehicleConnection { get; set; }
95+
public FilmVehiclesConnection VehicleConnection => _vehicleConnection.Value(() => GetFirstMethodValue<FilmVehiclesConnection>("vehicleConnection"));
96+
// public FilmVehiclesConnection VehicleConnection { get; set; }
8297

98+
99+
100+
private LazyProperty<FilmCharactersConnection> _characterConnection = new();
83101
/// <summary>
84102
/// Do not use in Query, only to retrive result
85103
/// </summary>
86104
[GraphShadowProperty]
87-
[JsonPropertyName("characterConnection")]
88-
public FilmCharactersConnection CharacterConnection { get; set; }
105+
public FilmCharactersConnection CharacterConnection => _characterConnection.Value(() => GetFirstMethodValue<FilmCharactersConnection>("characterConnection"));
106+
// public FilmCharactersConnection CharacterConnection { get; set; }
107+
89108

109+
110+
private LazyProperty<FilmPlanetsConnection> _planetConnection = new();
90111
/// <summary>
91112
/// Do not use in Query, only to retrive result
92113
/// </summary>
93114
[GraphShadowProperty]
94-
[JsonPropertyName("planetConnection")]
95-
public FilmPlanetsConnection PlanetConnection { get; set; }
115+
public FilmPlanetsConnection PlanetConnection => _planetConnection.Value(() => GetFirstMethodValue<FilmPlanetsConnection>("planetConnection"));
116+
// public FilmPlanetsConnection PlanetConnection { get; set; }
117+
96118

97-
[JsonPropertyName("created")]
119+
[JsonPropertyName("created")]
98120
public string Created { get; set; }
99121

100-
[JsonPropertyName("edited")]
122+
123+
[JsonPropertyName("edited")]
101124
public string Edited { get; set; }
102125

103-
[JsonPropertyName("id")]
126+
127+
[JsonPropertyName("id")]
104128
public string Id { get; set; }
105129

106130

131+
132+
133+
134+
107135
[JsonPropertyName("__typename")]
108136
public string __TypeName { get; set; }
109137
}

docs/StarWars.Client/Generated/Types/FilmCharactersConnection.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmCharactersConnection : Linq2GraphQL.Client.Common.ICursorPaging
9+
public partial class FilmCharactersConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
910
{
10-
[JsonPropertyName("pageInfo")]
11+
[JsonPropertyName("pageInfo")]
1112
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
1213

13-
[JsonPropertyName("edges")]
14+
15+
[JsonPropertyName("edges")]
1416
public List<FilmCharactersEdge> Edges { get; set; }
1517

16-
[JsonPropertyName("totalCount")]
18+
19+
[JsonPropertyName("totalCount")]
1720
public int? TotalCount { get; set; }
1821

19-
[JsonPropertyName("characters")]
22+
23+
[JsonPropertyName("characters")]
2024
public List<Person> Characters { get; set; }
2125

2226

27+
28+
29+
30+
2331
}

docs/StarWars.Client/Generated/Types/FilmCharactersEdge.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmCharactersEdge
9+
public partial class FilmCharactersEdge : GraphQLTypeBase
910
{
10-
[JsonPropertyName("node")]
11+
[JsonPropertyName("node")]
1112
public Person Node { get; set; }
1213

13-
[JsonPropertyName("cursor")]
14+
15+
[JsonPropertyName("cursor")]
1416
public string Cursor { get; set; }
1517

1618

19+
20+
21+
22+
1723
}

docs/StarWars.Client/Generated/Types/FilmPlanetsConnection.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmPlanetsConnection : Linq2GraphQL.Client.Common.ICursorPaging
9+
public partial class FilmPlanetsConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
910
{
10-
[JsonPropertyName("pageInfo")]
11+
[JsonPropertyName("pageInfo")]
1112
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
1213

13-
[JsonPropertyName("edges")]
14+
15+
[JsonPropertyName("edges")]
1416
public List<FilmPlanetsEdge> Edges { get; set; }
1517

16-
[JsonPropertyName("totalCount")]
18+
19+
[JsonPropertyName("totalCount")]
1720
public int? TotalCount { get; set; }
1821

19-
[JsonPropertyName("planets")]
22+
23+
[JsonPropertyName("planets")]
2024
public List<Planet> Planets { get; set; }
2125

2226

27+
28+
29+
30+
2331
}

docs/StarWars.Client/Generated/Types/FilmPlanetsEdge.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmPlanetsEdge
9+
public partial class FilmPlanetsEdge : GraphQLTypeBase
910
{
10-
[JsonPropertyName("node")]
11+
[JsonPropertyName("node")]
1112
public Planet Node { get; set; }
1213

13-
[JsonPropertyName("cursor")]
14+
15+
[JsonPropertyName("cursor")]
1416
public string Cursor { get; set; }
1517

1618

19+
20+
21+
22+
1723
}

docs/StarWars.Client/Generated/Types/FilmSpeciesConnection.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmSpeciesConnection : Linq2GraphQL.Client.Common.ICursorPaging
9+
public partial class FilmSpeciesConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
910
{
10-
[JsonPropertyName("pageInfo")]
11+
[JsonPropertyName("pageInfo")]
1112
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
1213

13-
[JsonPropertyName("edges")]
14+
15+
[JsonPropertyName("edges")]
1416
public List<FilmSpeciesEdge> Edges { get; set; }
1517

16-
[JsonPropertyName("totalCount")]
18+
19+
[JsonPropertyName("totalCount")]
1720
public int? TotalCount { get; set; }
1821

19-
[JsonPropertyName("species")]
22+
23+
[JsonPropertyName("species")]
2024
public List<Species> Species { get; set; }
2125

2226

27+
28+
29+
30+
2331
}

docs/StarWars.Client/Generated/Types/FilmSpeciesEdge.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmSpeciesEdge
9+
public partial class FilmSpeciesEdge : GraphQLTypeBase
910
{
10-
[JsonPropertyName("node")]
11+
[JsonPropertyName("node")]
1112
public Species Node { get; set; }
1213

13-
[JsonPropertyName("cursor")]
14+
15+
[JsonPropertyName("cursor")]
1416
public string Cursor { get; set; }
1517

1618

19+
20+
21+
22+
1723
}

docs/StarWars.Client/Generated/Types/FilmStarshipsConnection.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
using System.Collections.Generic;
33
using System.Text.Json.Serialization;
44
using Linq2GraphQL.Client;
5+
using Linq2GraphQL.Client.Common;
56

67
namespace StarWars.Client;
78

8-
public partial class FilmStarshipsConnection : Linq2GraphQL.Client.Common.ICursorPaging
9+
public partial class FilmStarshipsConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
910
{
10-
[JsonPropertyName("pageInfo")]
11+
[JsonPropertyName("pageInfo")]
1112
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
1213

13-
[JsonPropertyName("edges")]
14+
15+
[JsonPropertyName("edges")]
1416
public List<FilmStarshipsEdge> Edges { get; set; }
1517

16-
[JsonPropertyName("totalCount")]
18+
19+
[JsonPropertyName("totalCount")]
1720
public int? TotalCount { get; set; }
1821

19-
[JsonPropertyName("starships")]
22+
23+
[JsonPropertyName("starships")]
2024
public List<Starship> Starships { get; set; }
2125

2226

27+
28+
29+
30+
2331
}

0 commit comments

Comments
 (0)