Skip to content

Commit 8ae2637

Browse files
authored
Merge pull request #55 from Linq2GraphQL/fix-demo-run
Fixed Multiline description
2 parents a2dd391 + c76f824 commit 8ae2637

61 files changed

Lines changed: 1972 additions & 793 deletions

Some content is hidden

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

docs/Linq2GraphQL.Docs/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
x.SubscriptionProtocol = SubscriptionProtocol.ServerSentEvents;
1919
})
2020
.WithHttpClient(
21-
httpClient => { httpClient.BaseAddress = new Uri("https://swapi-graphql.netlify.app/.netlify/functions/index"); });
21+
httpClient => { httpClient.BaseAddress = new Uri("https://swapi-graphql.netlify.app/graphql"); });
2222

2323
await builder.Build().RunAsync();

docs/StarWars.Client/Generated/Client/RootMethods.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using System.Collections.Generic;
29
using System;
310
using Linq2GraphQL.Client;

docs/StarWars.Client/Generated/Client/StarWarsClient.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using Linq2GraphQL.Client;
29
using Microsoft.Extensions.Caching.Memory;
310
using Microsoft.Extensions.DependencyInjection;
@@ -7,7 +14,7 @@ namespace StarWars.Client;
714

815
public class StarWarsClient
916
{
10-
public StarWarsClient(HttpClient httpClient, IOptions<GraphClientOptions> options, IServiceProvider provider)
17+
public StarWarsClient(HttpClient httpClient, [FromKeyedServices("StarWarsClient")]IOptions<GraphClientOptions> options, IServiceProvider provider)
1118
{
1219
var client = new GraphClient(httpClient, options, provider);
1320
Query = new RootMethods(client);

docs/StarWars.Client/Generated/Client/StarWarsClientExtensions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using Linq2GraphQL.Client;
29
using Microsoft.Extensions.DependencyInjection;
310
using Microsoft.Extensions.Options;
@@ -26,7 +33,7 @@ private static IGraphClientBuilder<StarWarsClient> GraphClientBuilder(IServiceCo
2633
GraphClientOptions graphClientOptions)
2734
{
2835
var opts = Options.Create(graphClientOptions);
29-
services.AddSingleton(opts);
36+
services.AddKeyedSingleton(ClientName, opts);
3037
services.AddMemoryCache();
3138
return new ClientBuilder<StarWarsClient>(ClientName, services);
3239
}

docs/StarWars.Client/Generated/Inputs/InputFactory.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using System;
29
using System.Collections.Generic;
310
using System.Text.Json.Serialization;

docs/StarWars.Client/Generated/Interfaces/Node.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using System;
29
using System.Text.Json;
310
using System.Text.Json.Nodes;
@@ -93,19 +100,19 @@ internal class NodeConverter : InterfaceJsonConverter<Node>
93100
[JsonConverter(typeof(NodeConverter))]
94101
public interface Node
95102
{
96-
[JsonPropertyName("id")]
103+
[GraphQLMember("id")]
97104
public string Id { get; set; }
98-
[JsonPropertyName("__typename")]
105+
[GraphQLMember("__typename")]
99106
public string __TypeName { get; set; }
100107

101108
}
102109

103110
internal class Node__Concrete : Node
104111
{
105-
[JsonPropertyName("id")]
112+
[GraphQLMember("id")]
106113
public string Id { get; set; }
107114

108-
[JsonPropertyName("__typename")]
115+
[GraphQLMember("__typename")]
109116
public string __TypeName { get; set; }
110117

111118
}
Lines changed: 73 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using System;
29
using System.Collections.Generic;
310
using System.Text.Json.Serialization;
@@ -6,132 +13,140 @@
613

714
namespace StarWars.Client;
815

16+
917
public static class FilmExtensions
1018
{
11-
[GraphMethod("speciesConnection")]
12-
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)
19+
[GraphQLMember("speciesConnection")]
20+
public static FilmSpeciesConnection SpeciesConnection(this Film film, [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null)
1321
{
14-
return film.GetMethodValue<FilmSpeciesConnection>("speciesConnection", after, first, before, last);
22+
return film.GetMethodValue<FilmSpeciesConnection>("speciesConnection", after, first, before, last);
1523
}
1624

17-
[GraphMethod("starshipConnection")]
18-
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)
25+
[GraphQLMember("starshipConnection")]
26+
public static FilmStarshipsConnection StarshipConnection(this Film film, [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null)
1927
{
20-
return film.GetMethodValue<FilmStarshipsConnection>("starshipConnection", after, first, before, last);
28+
return film.GetMethodValue<FilmStarshipsConnection>("starshipConnection", after, first, before, last);
2129
}
2230

23-
[GraphMethod("vehicleConnection")]
24-
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)
31+
[GraphQLMember("vehicleConnection")]
32+
public static FilmVehiclesConnection VehicleConnection(this Film film, [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null)
2533
{
26-
return film.GetMethodValue<FilmVehiclesConnection>("vehicleConnection", after, first, before, last);
34+
return film.GetMethodValue<FilmVehiclesConnection>("vehicleConnection", after, first, before, last);
2735
}
2836

29-
[GraphMethod("characterConnection")]
30-
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)
37+
[GraphQLMember("characterConnection")]
38+
public static FilmCharactersConnection CharacterConnection(this Film film, [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null)
3139
{
32-
return film.GetMethodValue<FilmCharactersConnection>("characterConnection", after, first, before, last);
40+
return film.GetMethodValue<FilmCharactersConnection>("characterConnection", after, first, before, last);
3341
}
3442

35-
[GraphMethod("planetConnection")]
36-
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)
43+
[GraphQLMember("planetConnection")]
44+
public static FilmPlanetsConnection PlanetConnection(this Film film, [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null)
3745
{
38-
return film.GetMethodValue<FilmPlanetsConnection>("planetConnection", after, first, before, last);
46+
return film.GetMethodValue<FilmPlanetsConnection>("planetConnection", after, first, before, last);
3947
}
4048

4149
}
4250

51+
/// <summary>
52+
/// A single film.
53+
/// </summary>
4354
public partial class Film : GraphQLTypeBase, Node
4455
{
56+
/// <summary>
57+
/// The title of this film.
58+
/// </summary>
59+
[GraphQLMember("title")]
4560
[JsonPropertyName("title")]
46-
public string Title { get; set; }
47-
61+
public string Title { get; set; }
4862

63+
/// <summary>
64+
/// The episode number of this film.
65+
/// </summary>
66+
[GraphQLMember("episodeID")]
4967
[JsonPropertyName("episodeID")]
50-
public int? EpisodeID { get; set; }
51-
68+
public int? EpisodeID { get; set; }
5269

70+
/// <summary>
71+
/// The opening paragraphs at the beginning of this film.
72+
/// </summary>
73+
[GraphQLMember("openingCrawl")]
5374
[JsonPropertyName("openingCrawl")]
54-
public string OpeningCrawl { get; set; }
55-
75+
public string OpeningCrawl { get; set; }
5676

77+
/// <summary>
78+
/// The name of the director of this film.
79+
/// </summary>
80+
[GraphQLMember("director")]
5781
[JsonPropertyName("director")]
58-
public string Director { get; set; }
59-
82+
public string Director { get; set; }
6083

84+
/// <summary>
85+
/// The name(s) of the producer(s) of this film.
86+
/// </summary>
87+
[GraphQLMember("producers")]
6188
[JsonPropertyName("producers")]
62-
public List<string> Producers { get; set; }
63-
89+
public List<string> Producers { get; set; }
6490

91+
/// <summary>
92+
/// The ISO 8601 date format of film release at original creator country.
93+
/// </summary>
94+
[GraphQLMember("releaseDate")]
6595
[JsonPropertyName("releaseDate")]
66-
public string ReleaseDate { get; set; }
67-
68-
96+
public string ReleaseDate { get; set; }
6997

7098
private LazyProperty<FilmSpeciesConnection> _speciesConnection = new();
7199
/// <summary>
72100
/// Do not use in Query, only to retrive result
73101
/// </summary>
74-
[GraphShadowProperty]
75102
public FilmSpeciesConnection SpeciesConnection => _speciesConnection.Value(() => GetFirstMethodValue<FilmSpeciesConnection>("speciesConnection"));
76-
// public FilmSpeciesConnection SpeciesConnection { get; set; }
77-
78-
79103

80104
private LazyProperty<FilmStarshipsConnection> _starshipConnection = new();
81105
/// <summary>
82106
/// Do not use in Query, only to retrive result
83107
/// </summary>
84-
[GraphShadowProperty]
85108
public FilmStarshipsConnection StarshipConnection => _starshipConnection.Value(() => GetFirstMethodValue<FilmStarshipsConnection>("starshipConnection"));
86-
// public FilmStarshipsConnection StarshipConnection { get; set; }
87-
88-
89109

90110
private LazyProperty<FilmVehiclesConnection> _vehicleConnection = new();
91111
/// <summary>
92112
/// Do not use in Query, only to retrive result
93113
/// </summary>
94-
[GraphShadowProperty]
95114
public FilmVehiclesConnection VehicleConnection => _vehicleConnection.Value(() => GetFirstMethodValue<FilmVehiclesConnection>("vehicleConnection"));
96-
// public FilmVehiclesConnection VehicleConnection { get; set; }
97-
98-
99115

100116
private LazyProperty<FilmCharactersConnection> _characterConnection = new();
101117
/// <summary>
102118
/// Do not use in Query, only to retrive result
103119
/// </summary>
104-
[GraphShadowProperty]
105120
public FilmCharactersConnection CharacterConnection => _characterConnection.Value(() => GetFirstMethodValue<FilmCharactersConnection>("characterConnection"));
106-
// public FilmCharactersConnection CharacterConnection { get; set; }
107-
108-
109121

110122
private LazyProperty<FilmPlanetsConnection> _planetConnection = new();
111123
/// <summary>
112124
/// Do not use in Query, only to retrive result
113125
/// </summary>
114-
[GraphShadowProperty]
115126
public FilmPlanetsConnection PlanetConnection => _planetConnection.Value(() => GetFirstMethodValue<FilmPlanetsConnection>("planetConnection"));
116-
// public FilmPlanetsConnection PlanetConnection { get; set; }
117-
118127

128+
/// <summary>
129+
/// The ISO 8601 date format of the time that this resource was created.
130+
/// </summary>
131+
[GraphQLMember("created")]
119132
[JsonPropertyName("created")]
120-
public string Created { get; set; }
121-
133+
public string Created { get; set; }
122134

135+
/// <summary>
136+
/// The ISO 8601 date format of the time that this resource was edited.
137+
/// </summary>
138+
[GraphQLMember("edited")]
123139
[JsonPropertyName("edited")]
124-
public string Edited { get; set; }
125-
140+
public string Edited { get; set; }
126141

142+
/// <summary>
143+
/// The ID of an object
144+
/// </summary>
145+
[GraphQLMember("id")]
127146
[JsonPropertyName("id")]
128-
public string Id { get; set; }
129-
130-
131-
132-
133-
147+
public string Id { get; set; }
134148

149+
[GraphQLMember("__typename")]
135150
[JsonPropertyName("__typename")]
136151
public string __TypeName { get; set; }
137-
}
152+
}
Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
//---------------------------------------------------------------------
2+
// This code was automatically generated by Linq2GraphQL
3+
// Please don't edit this file
4+
// Github:https://github.com/linq2graphql/linq2graphql.client
5+
// Url: https://linq2graphql.com
6+
//---------------------------------------------------------------------
7+
18
using System;
29
using System.Collections.Generic;
310
using System.Text.Json.Serialization;
@@ -6,26 +13,46 @@
613

714
namespace StarWars.Client;
815

16+
17+
/// <summary>
18+
/// A connection to a list of items.
19+
/// </summary>
920
public partial class FilmCharactersConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
1021
{
22+
/// <summary>
23+
/// Information to aid in pagination.
24+
/// </summary>
25+
[GraphQLMember("pageInfo")]
1126
[JsonPropertyName("pageInfo")]
12-
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
13-
27+
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }
1428

29+
/// <summary>
30+
/// A list of edges.
31+
/// </summary>
32+
[GraphQLMember("edges")]
1533
[JsonPropertyName("edges")]
16-
public List<FilmCharactersEdge> Edges { get; set; }
17-
18-
34+
public List<FilmCharactersEdge> Edges { get; set; }
35+
36+
/// <summary>
37+
/// A count of the total number of objects in this connection, ignoring pagination.
38+
/// This allows a client to fetch the first five objects by passing "5" as the
39+
/// argument to "first", then fetch the total count so it could display "5 of 83",
40+
/// for example.
41+
/// </summary>
42+
[GraphQLMember("totalCount")]
1943
[JsonPropertyName("totalCount")]
20-
public int? TotalCount { get; set; }
21-
22-
44+
public int? TotalCount { get; set; }
45+
46+
/// <summary>
47+
/// A list of all of the objects returned in the connection. This is a convenience
48+
/// field provided for quickly exploring the API; rather than querying for
49+
/// "{ edges { node } }" when no edge data is needed, this field can be be used
50+
/// instead. Note that when clients like Relay need to fetch the "cursor" field on
51+
/// the edge to enable efficient pagination, this shortcut cannot be used, and the
52+
/// full "{ edges { node } }" version should be used instead.
53+
/// </summary>
54+
[GraphQLMember("characters")]
2355
[JsonPropertyName("characters")]
24-
public List<Person> Characters { get; set; }
25-
26-
27-
28-
29-
56+
public List<Person> Characters { get; set; }
3057

3158
}

0 commit comments

Comments
 (0)