Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Linq2GraphQL.Docs/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
x.SubscriptionProtocol = SubscriptionProtocol.ServerSentEvents;
})
.WithHttpClient(
httpClient => { httpClient.BaseAddress = new Uri("https://swapi-graphql.netlify.app/.netlify/functions/index"); });
httpClient => { httpClient.BaseAddress = new Uri("https://swapi-graphql.netlify.app/graphql"); });

await builder.Build().RunAsync();
7 changes: 7 additions & 0 deletions docs/StarWars.Client/Generated/Client/RootMethods.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using System.Collections.Generic;
using System;
using Linq2GraphQL.Client;
Expand Down
9 changes: 8 additions & 1 deletion docs/StarWars.Client/Generated/Client/StarWarsClient.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using Linq2GraphQL.Client;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.DependencyInjection;
Expand All @@ -7,7 +14,7 @@ namespace StarWars.Client;

public class StarWarsClient
{
public StarWarsClient(HttpClient httpClient, IOptions<GraphClientOptions> options, IServiceProvider provider)
public StarWarsClient(HttpClient httpClient, [FromKeyedServices("StarWarsClient")]IOptions<GraphClientOptions> options, IServiceProvider provider)
{
var client = new GraphClient(httpClient, options, provider);
Query = new RootMethods(client);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using Linq2GraphQL.Client;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -26,7 +33,7 @@ private static IGraphClientBuilder<StarWarsClient> GraphClientBuilder(IServiceCo
GraphClientOptions graphClientOptions)
{
var opts = Options.Create(graphClientOptions);
services.AddSingleton(opts);
services.AddKeyedSingleton(ClientName, opts);
services.AddMemoryCache();
return new ClientBuilder<StarWarsClient>(ClientName, services);
}
Expand Down
7 changes: 7 additions & 0 deletions docs/StarWars.Client/Generated/Inputs/InputFactory.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
Expand Down
15 changes: 11 additions & 4 deletions docs/StarWars.Client/Generated/Interfaces/Node.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using System;
using System.Text.Json;
using System.Text.Json.Nodes;
Expand Down Expand Up @@ -93,19 +100,19 @@ internal class NodeConverter : InterfaceJsonConverter<Node>
[JsonConverter(typeof(NodeConverter))]
public interface Node
{
[JsonPropertyName("id")]
[GraphQLMember("id")]
public string Id { get; set; }
[JsonPropertyName("__typename")]
[GraphQLMember("__typename")]
public string __TypeName { get; set; }

}

internal class Node__Concrete : Node
{
[JsonPropertyName("id")]
[GraphQLMember("id")]
public string Id { get; set; }

[JsonPropertyName("__typename")]
[GraphQLMember("__typename")]
public string __TypeName { get; set; }

}
131 changes: 73 additions & 58 deletions docs/StarWars.Client/Generated/Types/Film.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
Expand All @@ -6,132 +13,140 @@

namespace StarWars.Client;


public static class FilmExtensions
{
[GraphMethod("speciesConnection")]
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)
[GraphQLMember("speciesConnection")]
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)
{
return film.GetMethodValue<FilmSpeciesConnection>("speciesConnection", after, first, before, last);
return film.GetMethodValue<FilmSpeciesConnection>("speciesConnection", after, first, before, last);
}

[GraphMethod("starshipConnection")]
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)
[GraphQLMember("starshipConnection")]
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)
{
return film.GetMethodValue<FilmStarshipsConnection>("starshipConnection", after, first, before, last);
return film.GetMethodValue<FilmStarshipsConnection>("starshipConnection", after, first, before, last);
}

[GraphMethod("vehicleConnection")]
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)
[GraphQLMember("vehicleConnection")]
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)
{
return film.GetMethodValue<FilmVehiclesConnection>("vehicleConnection", after, first, before, last);
return film.GetMethodValue<FilmVehiclesConnection>("vehicleConnection", after, first, before, last);
}

[GraphMethod("characterConnection")]
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)
[GraphQLMember("characterConnection")]
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)
{
return film.GetMethodValue<FilmCharactersConnection>("characterConnection", after, first, before, last);
return film.GetMethodValue<FilmCharactersConnection>("characterConnection", after, first, before, last);
}

[GraphMethod("planetConnection")]
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)
[GraphQLMember("planetConnection")]
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)
{
return film.GetMethodValue<FilmPlanetsConnection>("planetConnection", after, first, before, last);
return film.GetMethodValue<FilmPlanetsConnection>("planetConnection", after, first, before, last);
}

}

/// <summary>
/// A single film.
/// </summary>
public partial class Film : GraphQLTypeBase, Node
{
/// <summary>
/// The title of this film.
/// </summary>
[GraphQLMember("title")]
[JsonPropertyName("title")]
public string Title { get; set; }

public string Title { get; set; }

/// <summary>
/// The episode number of this film.
/// </summary>
[GraphQLMember("episodeID")]
[JsonPropertyName("episodeID")]
public int? EpisodeID { get; set; }

public int? EpisodeID { get; set; }

/// <summary>
/// The opening paragraphs at the beginning of this film.
/// </summary>
[GraphQLMember("openingCrawl")]
[JsonPropertyName("openingCrawl")]
public string OpeningCrawl { get; set; }

public string OpeningCrawl { get; set; }

/// <summary>
/// The name of the director of this film.
/// </summary>
[GraphQLMember("director")]
[JsonPropertyName("director")]
public string Director { get; set; }

public string Director { get; set; }

/// <summary>
/// The name(s) of the producer(s) of this film.
/// </summary>
[GraphQLMember("producers")]
[JsonPropertyName("producers")]
public List<string> Producers { get; set; }

public List<string> Producers { get; set; }

/// <summary>
/// The ISO 8601 date format of film release at original creator country.
/// </summary>
[GraphQLMember("releaseDate")]
[JsonPropertyName("releaseDate")]
public string ReleaseDate { get; set; }


public string ReleaseDate { get; set; }

private LazyProperty<FilmSpeciesConnection> _speciesConnection = new();
/// <summary>
/// Do not use in Query, only to retrive result
/// </summary>
[GraphShadowProperty]
public FilmSpeciesConnection SpeciesConnection => _speciesConnection.Value(() => GetFirstMethodValue<FilmSpeciesConnection>("speciesConnection"));
// public FilmSpeciesConnection SpeciesConnection { get; set; }



private LazyProperty<FilmStarshipsConnection> _starshipConnection = new();
/// <summary>
/// Do not use in Query, only to retrive result
/// </summary>
[GraphShadowProperty]
public FilmStarshipsConnection StarshipConnection => _starshipConnection.Value(() => GetFirstMethodValue<FilmStarshipsConnection>("starshipConnection"));
// public FilmStarshipsConnection StarshipConnection { get; set; }



private LazyProperty<FilmVehiclesConnection> _vehicleConnection = new();
/// <summary>
/// Do not use in Query, only to retrive result
/// </summary>
[GraphShadowProperty]
public FilmVehiclesConnection VehicleConnection => _vehicleConnection.Value(() => GetFirstMethodValue<FilmVehiclesConnection>("vehicleConnection"));
// public FilmVehiclesConnection VehicleConnection { get; set; }



private LazyProperty<FilmCharactersConnection> _characterConnection = new();
/// <summary>
/// Do not use in Query, only to retrive result
/// </summary>
[GraphShadowProperty]
public FilmCharactersConnection CharacterConnection => _characterConnection.Value(() => GetFirstMethodValue<FilmCharactersConnection>("characterConnection"));
// public FilmCharactersConnection CharacterConnection { get; set; }



private LazyProperty<FilmPlanetsConnection> _planetConnection = new();
/// <summary>
/// Do not use in Query, only to retrive result
/// </summary>
[GraphShadowProperty]
public FilmPlanetsConnection PlanetConnection => _planetConnection.Value(() => GetFirstMethodValue<FilmPlanetsConnection>("planetConnection"));
// public FilmPlanetsConnection PlanetConnection { get; set; }


/// <summary>
/// The ISO 8601 date format of the time that this resource was created.
/// </summary>
[GraphQLMember("created")]
[JsonPropertyName("created")]
public string Created { get; set; }

public string Created { get; set; }

/// <summary>
/// The ISO 8601 date format of the time that this resource was edited.
/// </summary>
[GraphQLMember("edited")]
[JsonPropertyName("edited")]
public string Edited { get; set; }

public string Edited { get; set; }

/// <summary>
/// The ID of an object
/// </summary>
[GraphQLMember("id")]
[JsonPropertyName("id")]
public string Id { get; set; }





public string Id { get; set; }

[GraphQLMember("__typename")]
[JsonPropertyName("__typename")]
public string __TypeName { get; set; }
}
}
55 changes: 41 additions & 14 deletions docs/StarWars.Client/Generated/Types/FilmCharactersConnection.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//---------------------------------------------------------------------
// This code was automatically generated by Linq2GraphQL
// Please don't edit this file
// Github:https://github.com/linq2graphql/linq2graphql.client
// Url: https://linq2graphql.com
//---------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
Expand All @@ -6,26 +13,46 @@

namespace StarWars.Client;


/// <summary>
/// A connection to a list of items.
/// </summary>
public partial class FilmCharactersConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging
{
/// <summary>
/// Information to aid in pagination.
/// </summary>
[GraphQLMember("pageInfo")]
[JsonPropertyName("pageInfo")]
public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }

public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; }

/// <summary>
/// A list of edges.
/// </summary>
[GraphQLMember("edges")]
[JsonPropertyName("edges")]
public List<FilmCharactersEdge> Edges { get; set; }


public List<FilmCharactersEdge> Edges { get; set; }

/// <summary>
/// A count of the total number of objects in this connection, ignoring pagination.
/// This allows a client to fetch the first five objects by passing "5" as the
/// argument to "first", then fetch the total count so it could display "5 of 83",
/// for example.
/// </summary>
[GraphQLMember("totalCount")]
[JsonPropertyName("totalCount")]
public int? TotalCount { get; set; }


public int? TotalCount { get; set; }

/// <summary>
/// A list of all of the objects returned in the connection. This is a convenience
/// field provided for quickly exploring the API; rather than querying for
/// "{ edges { node } }" when no edge data is needed, this field can be be used
/// instead. Note that when clients like Relay need to fetch the "cursor" field on
/// the edge to enable efficient pagination, this shortcut cannot be used, and the
/// full "{ edges { node } }" version should be used instead.
/// </summary>
[GraphQLMember("characters")]
[JsonPropertyName("characters")]
public List<Person> Characters { get; set; }





public List<Person> Characters { get; set; }

}
Loading