22using System . Collections . Generic ;
33using System . Text . Json . Serialization ;
44using Linq2GraphQL . Client ;
5+ using Linq2GraphQL . Client . Common ;
56
67namespace 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 }
0 commit comments