diff --git a/StartGG/Client/Generated/Client/MutationMethods.cs b/StartGG/Client/Generated/Client/MutationMethods.cs index fdd44076..d6983dfd 100644 --- a/StartGG/Client/Generated/Client/MutationMethods.cs +++ b/StartGG/Client/Generated/Client/MutationMethods.cs @@ -5,11 +5,13 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System.Collections.Generic; +using System; using Linq2GraphQL.Client; namespace StartGG.Client; -public class MutationMethods +public class MutationMethods : IMutationMethods { private readonly GraphClient client; @@ -18,174 +20,227 @@ public MutationMethods(GraphClient client) this.client = client; } + public GraphQuery AssignStation(ID setId, ID stationId) + { + var arguments = new List + { + new("setId","ID!", setId), + new("stationId","ID!", stationId), + }; + + return new GraphQuery(client, "assignStation", OperationType.Mutation, arguments); + } + + public GraphQuery AssignStream(ID setId, ID streamId) + { + var arguments = new List + { + new("setId","ID!", setId), + new("streamId","ID!", streamId), + }; + + return new GraphQuery(client, "assignStream", OperationType.Mutation, arguments); + } + public GraphQuery DeletePhase(ID phaseId) { - var arguments = new List { new("phaseId", "ID!", phaseId) }; + var arguments = new List + { + new("phaseId","ID!", phaseId), + }; - return new(client, "deletePhase", OperationType.Mutation, arguments); + return new GraphQuery(client, "deletePhase", OperationType.Mutation, arguments); } public GraphQuery DeleteStation(ID stationId) { - var arguments = new List { new("stationId", "ID!", stationId) }; + var arguments = new List + { + new("stationId","ID!", stationId), + }; - return new(client, "deleteStation", OperationType.Mutation, arguments); + return new GraphQuery(client, "deleteStation", OperationType.Mutation, arguments); } public GraphQuery DeleteWave(ID waveId) { - var arguments = new List { new("waveId", "ID!", waveId) }; + var arguments = new List + { + new("waveId","ID!", waveId), + }; - return new(client, "deleteWave", OperationType.Mutation, arguments); + return new GraphQuery(client, "deleteWave", OperationType.Mutation, arguments); } public GraphQuery GenerateRegistrationToken(TournamentRegistrationInput registration, ID userId) { - var arguments = new List + var arguments = new List { - new("registration", "TournamentRegistrationInput!", registration), new("userId", "ID!", userId) + new("registration","TournamentRegistrationInput!", registration), + new("userId","ID!", userId), }; - return new(client, "generateRegistrationToken", OperationType.Mutation, arguments); + return new GraphQuery(client, "generateRegistrationToken", OperationType.Mutation, arguments); } public GraphQuery MarkSetCalled(ID setId) { - var arguments = new List { new("setId", "ID!", setId) }; + var arguments = new List + { + new("setId","ID!", setId), + }; - return new(client, "markSetCalled", OperationType.Mutation, arguments); + return new GraphQuery(client, "markSetCalled", OperationType.Mutation, arguments); } public GraphQuery MarkSetInProgress(ID setId) { - var arguments = new List { new("setId", "ID!", setId) }; + var arguments = new List + { + new("setId","ID!", setId), + }; - return new(client, "markSetInProgress", OperationType.Mutation, arguments); + return new GraphQuery(client, "markSetInProgress", OperationType.Mutation, arguments); } - public GraphQuery RegisterForTournament(TournamentRegistrationInput registration = null, - string registrationToken = null) + public GraphQuery RegisterForTournament(TournamentRegistrationInput registration = null, string registrationToken = null) { - var arguments = new List + var arguments = new List { - new("registration", "TournamentRegistrationInput", registration), - new("registrationToken", "String", registrationToken) + new("registration","TournamentRegistrationInput", registration), + new("registrationToken","String", registrationToken), }; - return new(client, "registerForTournament", OperationType.Mutation, arguments); + return new GraphQuery(client, "registerForTournament", OperationType.Mutation, arguments); } - public GraphQuery> ReportBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, - List gameData = null) + public GraphQuery> ReportBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, List gameData = null) { - var arguments = new List + var arguments = new List { - new("setId", "ID!", setId), - new("winnerId", "ID", winnerId), - new("isDQ", "Boolean", isDQ), - new("gameData", "[BracketSetGameDataInput]", gameData) + new("setId","ID!", setId), + new("winnerId","ID", winnerId), + new("isDQ","Boolean", isDQ), + new("gameData","[BracketSetGameDataInput]", gameData), }; - return new(client, "reportBracketSet", OperationType.Mutation, arguments); + return new GraphQuery>(client, "reportBracketSet", OperationType.Mutation, arguments); } public GraphQuery ResetSet(ID setId, bool? resetDependentSets = null) { - var arguments = new List + var arguments = new List { - new("setId", "ID!", setId), new("resetDependentSets", "Boolean", resetDependentSets) + new("setId","ID!", setId), + new("resetDependentSets","Boolean", resetDependentSets), }; - return new(client, "resetSet", OperationType.Mutation, arguments); + return new GraphQuery(client, "resetSet", OperationType.Mutation, arguments); } public GraphQuery> ResolveScheduleConflicts(ID tournamentId, ResolveConflictsOptions options = null) { - var arguments = new List + var arguments = new List { - new("tournamentId", "ID!", tournamentId), new("options", "ResolveConflictsOptions", options) + new("tournamentId","ID!", tournamentId), + new("options","ResolveConflictsOptions", options), }; - return new(client, "resolveScheduleConflicts", OperationType.Mutation, arguments); + return new GraphQuery>(client, "resolveScheduleConflicts", OperationType.Mutation, arguments); } public GraphQuery> SwapSeeds(ID phaseId, ID seed1Id, ID seed2Id) { - var arguments = new List + var arguments = new List { - new("phaseId", "ID!", phaseId), new("seed1Id", "ID!", seed1Id), new("seed2Id", "ID!", seed2Id) + new("phaseId","ID!", phaseId), + new("seed1Id","ID!", seed1Id), + new("seed2Id","ID!", seed2Id), }; - return new(client, "swapSeeds", OperationType.Mutation, arguments); + return new GraphQuery>(client, "swapSeeds", OperationType.Mutation, arguments); } - public GraphQuery UpdateBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, - List gameData = null) + public GraphQuery UpdateBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, List gameData = null) { - var arguments = new List + var arguments = new List { - new("setId", "ID!", setId), - new("winnerId", "ID", winnerId), - new("isDQ", "Boolean", isDQ), - new("gameData", "[BracketSetGameDataInput]", gameData) + new("setId","ID!", setId), + new("winnerId","ID", winnerId), + new("isDQ","Boolean", isDQ), + new("gameData","[BracketSetGameDataInput]", gameData), }; - return new(client, "updateBracketSet", OperationType.Mutation, arguments); + return new GraphQuery(client, "updateBracketSet", OperationType.Mutation, arguments); } public GraphQuery> UpdatePhaseGroups(List groupConfigs) { - var arguments = new List { new("groupConfigs", "[PhaseGroupUpdateInput]!", groupConfigs) }; + var arguments = new List + { + new("groupConfigs","[PhaseGroupUpdateInput]!", groupConfigs), + }; + + return new GraphQuery>(client, "updatePhaseGroups", OperationType.Mutation, arguments); + } + + public GraphQuery UpdatePhaseSeeding(ID phaseId, List seedMapping, UpdatePhaseSeedingOptions options = null) + { + var arguments = new List + { + new("phaseId","ID!", phaseId), + new("seedMapping","[UpdatePhaseSeedInfo]!", seedMapping), + new("options","UpdatePhaseSeedingOptions", options), + }; - return new(client, "updatePhaseGroups", OperationType.Mutation, arguments); + return new GraphQuery(client, "updatePhaseSeeding", OperationType.Mutation, arguments); } - public GraphQuery UpdatePhaseSeeding(ID phaseId, List seedMapping, - UpdatePhaseSeedingOptions options = null) + public GraphQuery UpdateVodUrl(ID setId, string vodUrl = null) { - var arguments = new List + var arguments = new List { - new("phaseId", "ID!", phaseId), - new("seedMapping", "[UpdatePhaseSeedInfo]!", seedMapping), - new("options", "UpdatePhaseSeedingOptions", options) + new("setId","ID!", setId), + new("vodUrl","String", vodUrl), }; - return new(client, "updatePhaseSeeding", OperationType.Mutation, arguments); + return new GraphQuery(client, "updateVodUrl", OperationType.Mutation, arguments); } public GraphQuery UpsertPhase(PhaseUpsertInput payload, ID phaseId = null, ID eventId = null) { - var arguments = new List + var arguments = new List { - new("phaseId", "ID", phaseId), - new("eventId", "ID", eventId), - new("payload", "PhaseUpsertInput!", payload) + new("phaseId","ID", phaseId), + new("eventId","ID", eventId), + new("payload","PhaseUpsertInput!", payload), }; - return new(client, "upsertPhase", OperationType.Mutation, arguments); + return new GraphQuery(client, "upsertPhase", OperationType.Mutation, arguments); } public GraphQuery UpsertStation(StationUpsertInput fields, ID stationId = null, ID tournamentId = null) { - var arguments = new List + var arguments = new List { - new("stationId", "ID", stationId), - new("tournamentId", "ID", tournamentId), - new("fields", "StationUpsertInput!", fields) + new("stationId","ID", stationId), + new("tournamentId","ID", tournamentId), + new("fields","StationUpsertInput!", fields), }; - return new(client, "upsertStation", OperationType.Mutation, arguments); + return new GraphQuery(client, "upsertStation", OperationType.Mutation, arguments); } public GraphQuery UpsertWave(WaveUpsertInput fields, ID waveId = null, ID tournamentId = null) { - var arguments = new List + var arguments = new List { - new("waveId", "ID", waveId), - new("tournamentId", "ID", tournamentId), - new("fields", "WaveUpsertInput!", fields) + new("waveId","ID", waveId), + new("tournamentId","ID", tournamentId), + new("fields","WaveUpsertInput!", fields), }; - return new(client, "upsertWave", OperationType.Mutation, arguments); + return new GraphQuery(client, "upsertWave", OperationType.Mutation, arguments); + } + } -} \ No newline at end of file diff --git a/StartGG/Client/Generated/Client/QueryMethods.cs b/StartGG/Client/Generated/Client/QueryMethods.cs index 06df9ac6..e35d0bde 100644 --- a/StartGG/Client/Generated/Client/QueryMethods.cs +++ b/StartGG/Client/Generated/Client/QueryMethods.cs @@ -11,7 +11,7 @@ namespace StartGG.Client; -public class QueryMethods +public class QueryMethods : IQueryMethods { private readonly GraphClient client; diff --git a/StartGG/Client/Generated/Client/StartGGClient.cs b/StartGG/Client/Generated/Client/StartGGClient.cs index e55eb4b1..bd2ce6b5 100644 --- a/StartGG/Client/Generated/Client/StartGGClient.cs +++ b/StartGG/Client/Generated/Client/StartGGClient.cs @@ -11,16 +11,41 @@ namespace StartGG.Client; -public class StartGGClient -{ - public StartGGClient(HttpClient httpClient, - [FromKeyedServices("StartGGClient")] IOptions options, IServiceProvider provider) +/// +/// GraphQL client for StartGGClient operations +/// +/// +/// Provides strongly-typed access to GraphQL queries, mutations, and subscriptions. +/// Supports dependency injection for better testability and flexibility. +/// +public class StartGGClient : IStartGGClient +{ + /// + /// Constructor with dependency injection support + /// + /// HTTP client for GraphQL requests + /// GraphQL client configuration options + /// Service provider for dependency resolution + /// Optional query methods implementation (uses default if null) + /// Optional mutation methods implementation (uses default if null) + public StartGGClient( + HttpClient httpClient, + [FromKeyedServices("StartGGClient")] IOptions options, + IServiceProvider provider, + IQueryMethods queryMethods = null, + IMutationMethods mutationMethods = null) { - var client = new GraphClient(httpClient, options, provider); - Query = new(client); - Mutation = new(client); + var client = new GraphClient(httpClient, options, provider, false); + Query = queryMethods ?? new QueryMethods(client); + Mutation = mutationMethods ?? new MutationMethods(client); } - public QueryMethods Query { get; private set; } - public MutationMethods Mutation { get; private set; } + /// + /// Gets the query methods for this GraphQL client + /// + public IQueryMethods Query { get; private set; } + /// + /// Gets the mutation methods for this GraphQL client + /// + public IMutationMethods Mutation { get; private set; } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Client/StartGGClientExtensions.cs b/StartGG/Client/Generated/Client/StartGGClientExtensions.cs index 1215cd4f..d7673353 100644 --- a/StartGG/Client/Generated/Client/StartGGClientExtensions.cs +++ b/StartGG/Client/Generated/Client/StartGGClientExtensions.cs @@ -11,22 +11,21 @@ namespace StartGG.Client; -public static class StartGGClientExtensions +public static class StartGGClientExtensions { private const string ClientName = "StartGGClient"; - + public static IGraphClientBuilder AddStartGGClient(this IServiceCollection services) { var graphClientOptions = new GraphClientOptions(); return GraphClientBuilder(services, graphClientOptions); } - - public static IGraphClientBuilder AddStartGGClient(this IServiceCollection services, - Action opts) + + public static IGraphClientBuilder AddStartGGClient(this IServiceCollection services, Action opts) { var graphClientOptions = new GraphClientOptions(); opts(graphClientOptions); - + return GraphClientBuilder(services, graphClientOptions); } @@ -35,7 +34,7 @@ private static IGraphClientBuilder GraphClientBuilder(IServiceCol { var opts = Options.Create(graphClientOptions); services.AddKeyedSingleton(ClientName, opts); - services.AddMemoryCache(); + services.AddMemoryCache(); return new ClientBuilder(ClientName, services); } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/ActivityState.cs b/StartGG/Client/Generated/Enums/ActivityState.cs index 77a7ddae..920ed0ac 100644 --- a/StartGG/Client/Generated/Enums/ActivityState.cs +++ b/StartGG/Client/Generated/Enums/ActivityState.cs @@ -5,20 +5,27 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum ActivityState { - [EnumMember(Value = "CREATED")] Created, - [EnumMember(Value = "ACTIVE")] Active, - [EnumMember(Value = "COMPLETED")] Completed, - [EnumMember(Value = "READY")] Ready, - [EnumMember(Value = "INVALID")] Invalid, - [EnumMember(Value = "CALLED")] Called, - [EnumMember(Value = "QUEUED")] Queued + [EnumMember(Value = "CREATED")] + Created, + [EnumMember(Value = "ACTIVE")] + Active, + [EnumMember(Value = "COMPLETED")] + Completed, + [EnumMember(Value = "READY")] + Ready, + [EnumMember(Value = "INVALID")] + Invalid, + [EnumMember(Value = "CALLED")] + Called, + [EnumMember(Value = "QUEUED")] + Queued, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/AuthorizationType.cs b/StartGG/Client/Generated/Enums/AuthorizationType.cs index e84a88bd..991278b0 100644 --- a/StartGG/Client/Generated/Enums/AuthorizationType.cs +++ b/StartGG/Client/Generated/Enums/AuthorizationType.cs @@ -5,21 +5,31 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum AuthorizationType { - [EnumMember(Value = "TWITTER")] Twitter, - [EnumMember(Value = "TWITCH")] Twitch, - [EnumMember(Value = "STEAM")] Steam, - [EnumMember(Value = "DISCORD")] Discord, - [EnumMember(Value = "XBOX")] Xbox, - [EnumMember(Value = "EPIC")] Epic, - [EnumMember(Value = "BATTLENET")] Battlenet, - [EnumMember(Value = "MIXER")] Mixer + [EnumMember(Value = "TWITTER")] + Twitter, + [EnumMember(Value = "TWITCH")] + Twitch, + [EnumMember(Value = "STEAM")] + Steam, + [EnumMember(Value = "DISCORD")] + Discord, + [EnumMember(Value = "XBOX")] + Xbox, + [EnumMember(Value = "EPIC")] + Epic, + [EnumMember(Value = "BATTLENET")] + Battlenet, + [EnumMember(Value = "RIOT")] + Riot, + [EnumMember(Value = "MIXER")] + Mixer, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/BracketType.cs b/StartGG/Client/Generated/Enums/BracketType.cs index 2aa030e7..3ebd453e 100644 --- a/StartGG/Client/Generated/Enums/BracketType.cs +++ b/StartGG/Client/Generated/Enums/BracketType.cs @@ -5,9 +5,9 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; @@ -16,19 +16,22 @@ public enum BracketType { [EnumMember(Value = "SINGLE_ELIMINATION")] SingleElimination, - [EnumMember(Value = "DOUBLE_ELIMINATION")] DoubleElimination, - [EnumMember(Value = "ROUND_ROBIN")] RoundRobin, - [EnumMember(Value = "SWISS")] Swiss, - [EnumMember(Value = "EXHIBITION")] Exhibition, - + [EnumMember(Value = "ROUND_ROBIN")] + RoundRobin, + [EnumMember(Value = "SWISS")] + Swiss, + [EnumMember(Value = "EXHIBITION")] + Exhibition, [EnumMember(Value = "CUSTOM_SCHEDULE")] CustomSchedule, - [EnumMember(Value = "MATCHMAKING")] Matchmaking, - + [EnumMember(Value = "MATCHMAKING")] + Matchmaking, [EnumMember(Value = "ELIMINATION_ROUNDS")] EliminationRounds, - [EnumMember(Value = "RACE")] Race, - [EnumMember(Value = "CIRCUIT")] Circuit + [EnumMember(Value = "RACE")] + Race, + [EnumMember(Value = "CIRCUIT")] + Circuit, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/Comparator.cs b/StartGG/Client/Generated/Enums/Comparator.cs index d4e0e12f..5d82383f 100644 --- a/StartGG/Client/Generated/Enums/Comparator.cs +++ b/StartGG/Client/Generated/Enums/Comparator.cs @@ -5,22 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum Comparator { - [EnumMember(Value = "GREATER_THAN")] GreaterThan, - + [EnumMember(Value = "GREATER_THAN")] + GreaterThan, [EnumMember(Value = "GREATER_THAN_OR_EQUAL")] GreaterThanOrEqual, - [EnumMember(Value = "EQUAL")] Equal, - + [EnumMember(Value = "EQUAL")] + Equal, [EnumMember(Value = "LESS_THAN_OR_EQUAL")] LessThanOrEqual, - [EnumMember(Value = "LESS_THAN")] LessThan + [EnumMember(Value = "LESS_THAN")] + LessThan, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/GameSelectionType.cs b/StartGG/Client/Generated/Enums/GameSelectionType.cs index 1118ac2d..45f819e7 100644 --- a/StartGG/Client/Generated/Enums/GameSelectionType.cs +++ b/StartGG/Client/Generated/Enums/GameSelectionType.cs @@ -5,14 +5,15 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum GameSelectionType { - [EnumMember(Value = "CHARACTER")] Character + [EnumMember(Value = "CHARACTER")] + Character, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/MatchConfigVerificationMethod.cs b/StartGG/Client/Generated/Enums/MatchConfigVerificationMethod.cs index 0fc18384..fefd6d1a 100644 --- a/StartGG/Client/Generated/Enums/MatchConfigVerificationMethod.cs +++ b/StartGG/Client/Generated/Enums/MatchConfigVerificationMethod.cs @@ -5,18 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum MatchConfigVerificationMethod { - [EnumMember(Value = "TWITCH")] Twitch, - [EnumMember(Value = "STREAM_ME")] StreamMe, - [EnumMember(Value = "ANY")] Any, - [EnumMember(Value = "MIXER")] Mixer, - [EnumMember(Value = "YOUTUBE")] Youtube + [EnumMember(Value = "TWITCH")] + Twitch, + [EnumMember(Value = "STREAM_ME")] + StreamMe, + [EnumMember(Value = "ANY")] + Any, + [EnumMember(Value = "MIXER")] + Mixer, + [EnumMember(Value = "YOUTUBE")] + Youtube, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/SetSortType.cs b/StartGG/Client/Generated/Enums/SetSortType.cs index a7974859..42a5c79e 100644 --- a/StartGG/Client/Generated/Enums/SetSortType.cs +++ b/StartGG/Client/Generated/Enums/SetSortType.cs @@ -5,19 +5,25 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SetSortType { - [EnumMember(Value = "NONE")] None, - [EnumMember(Value = "CALL_ORDER")] CallOrder, - [EnumMember(Value = "MAGIC")] Magic, - [EnumMember(Value = "RECENT")] Recent, - [EnumMember(Value = "STANDARD")] Standard, - [EnumMember(Value = "ROUND")] Round + [EnumMember(Value = "NONE")] + None, + [EnumMember(Value = "CALL_ORDER")] + CallOrder, + [EnumMember(Value = "MAGIC")] + Magic, + [EnumMember(Value = "RECENT")] + Recent, + [EnumMember(Value = "STANDARD")] + Standard, + [EnumMember(Value = "ROUND")] + Round, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/SocialConnectionType.cs b/StartGG/Client/Generated/Enums/SocialConnectionType.cs index 7a6a1de1..c51ab1d6 100644 --- a/StartGG/Client/Generated/Enums/SocialConnectionType.cs +++ b/StartGG/Client/Generated/Enums/SocialConnectionType.cs @@ -5,18 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum SocialConnectionType { - [EnumMember(Value = "TWITTER")] Twitter, - [EnumMember(Value = "TWITCH")] Twitch, - [EnumMember(Value = "DISCORD")] Discord, - [EnumMember(Value = "MIXER")] Mixer, - [EnumMember(Value = "XBOX")] Xbox + [EnumMember(Value = "TWITTER")] + Twitter, + [EnumMember(Value = "TWITCH")] + Twitch, + [EnumMember(Value = "DISCORD")] + Discord, + [EnumMember(Value = "MIXER")] + Mixer, + [EnumMember(Value = "XBOX")] + Xbox, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/StreamSource.cs b/StartGG/Client/Generated/Enums/StreamSource.cs index f24e995d..c35777dc 100644 --- a/StartGG/Client/Generated/Enums/StreamSource.cs +++ b/StartGG/Client/Generated/Enums/StreamSource.cs @@ -5,18 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum StreamSource { - [EnumMember(Value = "TWITCH")] Twitch, - [EnumMember(Value = "HITBOX")] Hitbox, - [EnumMember(Value = "STREAMME")] Streamme, - [EnumMember(Value = "MIXER")] Mixer, - [EnumMember(Value = "YOUTUBE")] Youtube + [EnumMember(Value = "TWITCH")] + Twitch, + [EnumMember(Value = "HITBOX")] + Hitbox, + [EnumMember(Value = "STREAMME")] + Streamme, + [EnumMember(Value = "MIXER")] + Mixer, + [EnumMember(Value = "YOUTUBE")] + Youtube, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/StreamType.cs b/StartGG/Client/Generated/Enums/StreamType.cs index 5bc66a11..73c16c49 100644 --- a/StartGG/Client/Generated/Enums/StreamType.cs +++ b/StartGG/Client/Generated/Enums/StreamType.cs @@ -5,16 +5,19 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum StreamType { - [EnumMember(Value = "TWITCH")] Twitch, - [EnumMember(Value = "MIXER")] Mixer, - [EnumMember(Value = "YOUTUBE")] Youtube + [EnumMember(Value = "TWITCH")] + Twitch, + [EnumMember(Value = "MIXER")] + Mixer, + [EnumMember(Value = "YOUTUBE")] + Youtube, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/TeamMemberStatus.cs b/StartGG/Client/Generated/Enums/TeamMemberStatus.cs index 9ad02cde..c3ea17d7 100644 --- a/StartGG/Client/Generated/Enums/TeamMemberStatus.cs +++ b/StartGG/Client/Generated/Enums/TeamMemberStatus.cs @@ -5,20 +5,27 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum TeamMemberStatus { - [EnumMember(Value = "UNKNOWN")] Unknown, - [EnumMember(Value = "ACCEPTED")] Accepted, - [EnumMember(Value = "INVITED")] Invited, - [EnumMember(Value = "REQUEST")] Request, - [EnumMember(Value = "ALUM")] Alum, - [EnumMember(Value = "HIATUS")] Hiatus, - [EnumMember(Value = "OPEN_SPOT")] OpenSpot + [EnumMember(Value = "UNKNOWN")] + Unknown, + [EnumMember(Value = "ACCEPTED")] + Accepted, + [EnumMember(Value = "INVITED")] + Invited, + [EnumMember(Value = "REQUEST")] + Request, + [EnumMember(Value = "ALUM")] + Alum, + [EnumMember(Value = "HIATUS")] + Hiatus, + [EnumMember(Value = "OPEN_SPOT")] + OpenSpot, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/TeamMemberType.cs b/StartGG/Client/Generated/Enums/TeamMemberType.cs index 4678b2fe..46087d29 100644 --- a/StartGG/Client/Generated/Enums/TeamMemberType.cs +++ b/StartGG/Client/Generated/Enums/TeamMemberType.cs @@ -5,15 +5,17 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum TeamMemberType { - [EnumMember(Value = "PLAYER")] Player, - [EnumMember(Value = "STAFF")] Staff + [EnumMember(Value = "PLAYER")] + Player, + [EnumMember(Value = "STAFF")] + Staff, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Enums/TournamentPaginationSort.cs b/StartGG/Client/Generated/Enums/TournamentPaginationSort.cs index c5928c76..c464b898 100644 --- a/StartGG/Client/Generated/Enums/TournamentPaginationSort.cs +++ b/StartGG/Client/Generated/Enums/TournamentPaginationSort.cs @@ -5,21 +5,21 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using Linq2GraphQL.Client; using System.Runtime.Serialization; using System.Text.Json.Serialization; -using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(JsonStringEnumMemberConverter))] public enum TournamentPaginationSort { - [EnumMember(Value = "startAt")] Startat, - [EnumMember(Value = "endAt")] Endat, - + [EnumMember(Value = "startAt")] + Startat, + [EnumMember(Value = "endAt")] + Endat, [EnumMember(Value = "eventRegistrationClosesAt")] Eventregistrationclosesat, - [EnumMember(Value = "computedUpdatedAt")] - Computedupdatedat + Computedupdatedat, } \ No newline at end of file diff --git a/StartGG/Client/Generated/Inputs/EventEntrantPageQueryFilter.cs b/StartGG/Client/Generated/Inputs/EventEntrantPageQueryFilter.cs index b00ef5a5..56af9308 100644 --- a/StartGG/Client/Generated/Inputs/EventEntrantPageQueryFilter.cs +++ b/StartGG/Client/Generated/Inputs/EventEntrantPageQueryFilter.cs @@ -5,19 +5,22 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(GraphInputConverter))] -public class EventEntrantPageQueryFilter : GraphInputBase +public partial class EventEntrantPageQueryFilter : GraphInputBase { - [GraphQLMember("name")] - [JsonPropertyName("name")] - public string Name - { - get => GetValue("name"); - set => SetValue("name", value); - } + [GraphQLMember("name")] + [JsonPropertyName("name")] + public string Name + { + get => GetValue("name"); + set => SetValue("name", value); + } + } \ No newline at end of file diff --git a/StartGG/Client/Generated/Inputs/PhaseGroupPageQueryFilter.cs b/StartGG/Client/Generated/Inputs/PhaseGroupPageQueryFilter.cs index 9b5b3796..818f8fea 100644 --- a/StartGG/Client/Generated/Inputs/PhaseGroupPageQueryFilter.cs +++ b/StartGG/Client/Generated/Inputs/PhaseGroupPageQueryFilter.cs @@ -5,27 +5,30 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(GraphInputConverter))] -public class PhaseGroupPageQueryFilter : GraphInputBase +public partial class PhaseGroupPageQueryFilter : GraphInputBase { - [GraphQLMember("id")] - [JsonPropertyName("id")] - public List Id - { - get => GetValue>("id"); - set => SetValue("id", value); - } + [GraphQLMember("id")] + [JsonPropertyName("id")] + public List Id + { + get => GetValue>("id"); + set => SetValue("id", value); + } + + [GraphQLMember("waveId")] + [JsonPropertyName("waveId")] + public ID WaveId + { + get => GetValue("waveId"); + set => SetValue("waveId", value); + } - [GraphQLMember("waveId")] - [JsonPropertyName("waveId")] - public ID WaveId - { - get => GetValue("waveId"); - set => SetValue("waveId", value); - } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Inputs/ShopOrderMessagesQuery.cs b/StartGG/Client/Generated/Inputs/ShopOrderMessagesQuery.cs index 6e8574a1..272452f6 100644 --- a/StartGG/Client/Generated/Inputs/ShopOrderMessagesQuery.cs +++ b/StartGG/Client/Generated/Inputs/ShopOrderMessagesQuery.cs @@ -5,35 +5,38 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(GraphInputConverter))] -public class ShopOrderMessagesQuery : GraphInputBase +public partial class ShopOrderMessagesQuery : GraphInputBase { - [GraphQLMember("page")] - [JsonPropertyName("page")] - public int? Page - { - get => GetValue("page"); - set => SetValue("page", value); - } + [GraphQLMember("page")] + [JsonPropertyName("page")] + public int? Page + { + get => GetValue("page"); + set => SetValue("page", value); + } - [GraphQLMember("perPage")] - [JsonPropertyName("perPage")] - public int? PerPage - { - get => GetValue("perPage"); - set => SetValue("perPage", value); - } + [GraphQLMember("perPage")] + [JsonPropertyName("perPage")] + public int? PerPage + { + get => GetValue("perPage"); + set => SetValue("perPage", value); + } + + [GraphQLMember("sortBy")] + [JsonPropertyName("sortBy")] + public string SortBy + { + get => GetValue("sortBy"); + set => SetValue("sortBy", value); + } - [GraphQLMember("sortBy")] - [JsonPropertyName("sortBy")] - public string SortBy - { - get => GetValue("sortBy"); - set => SetValue("sortBy", value); - } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Inputs/TeamPaginationQuery.cs b/StartGG/Client/Generated/Inputs/TeamPaginationQuery.cs index be89d978..9aa2c66d 100644 --- a/StartGG/Client/Generated/Inputs/TeamPaginationQuery.cs +++ b/StartGG/Client/Generated/Inputs/TeamPaginationQuery.cs @@ -5,43 +5,46 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(GraphInputConverter))] -public class TeamPaginationQuery : GraphInputBase +public partial class TeamPaginationQuery : GraphInputBase { - [GraphQLMember("page")] - [JsonPropertyName("page")] - public int? Page - { - get => GetValue("page"); - set => SetValue("page", value); - } + [GraphQLMember("page")] + [JsonPropertyName("page")] + public int? Page + { + get => GetValue("page"); + set => SetValue("page", value); + } - [GraphQLMember("perPage")] - [JsonPropertyName("perPage")] - public int? PerPage - { - get => GetValue("perPage"); - set => SetValue("perPage", value); - } + [GraphQLMember("perPage")] + [JsonPropertyName("perPage")] + public int? PerPage + { + get => GetValue("perPage"); + set => SetValue("perPage", value); + } - [GraphQLMember("sortBy")] - [JsonPropertyName("sortBy")] - public string SortBy - { - get => GetValue("sortBy"); - set => SetValue("sortBy", value); - } + [GraphQLMember("sortBy")] + [JsonPropertyName("sortBy")] + public string SortBy + { + get => GetValue("sortBy"); + set => SetValue("sortBy", value); + } + + [GraphQLMember("filter")] + [JsonPropertyName("filter")] + public TeamPaginationFilter Filter + { + get => GetValue("filter"); + set => SetValue("filter", value); + } - [GraphQLMember("filter")] - [JsonPropertyName("filter")] - public TeamPaginationFilter Filter - { - get => GetValue("filter"); - set => SetValue("filter", value); - } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Inputs/WaveUpsertInput.cs b/StartGG/Client/Generated/Inputs/WaveUpsertInput.cs index ad8422a3..5a35e5df 100644 --- a/StartGG/Client/Generated/Inputs/WaveUpsertInput.cs +++ b/StartGG/Client/Generated/Inputs/WaveUpsertInput.cs @@ -5,35 +5,38 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; namespace StartGG.Client; [JsonConverter(typeof(GraphInputConverter))] -public class WaveUpsertInput : GraphInputBase +public partial class WaveUpsertInput : GraphInputBase { - [GraphQLMember("identifier")] - [JsonPropertyName("identifier")] - public string Identifier - { - get => GetValue("identifier"); - set => SetValue("identifier", value); - } + [GraphQLMember("identifier")] + [JsonPropertyName("identifier")] + public string Identifier + { + get => GetValue("identifier"); + set => SetValue("identifier", value); + } - [GraphQLMember("startAt")] - [JsonPropertyName("startAt")] - public Timestamp StartAt - { - get => GetValue("startAt"); - set => SetValue("startAt", value); - } + [GraphQLMember("startAt")] + [JsonPropertyName("startAt")] + public Timestamp StartAt + { + get => GetValue("startAt"); + set => SetValue("startAt", value); + } + + [GraphQLMember("endAt")] + [JsonPropertyName("endAt")] + public Timestamp EndAt + { + get => GetValue("endAt"); + set => SetValue("endAt", value); + } - [GraphQLMember("endAt")] - [JsonPropertyName("endAt")] - public Timestamp EndAt - { - get => GetValue("endAt"); - set => SetValue("endAt", value); - } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Interfaces/ActionSet.cs b/StartGG/Client/Generated/Interfaces/ActionSet.cs index 98327579..6e7b26ec 100644 --- a/StartGG/Client/Generated/Interfaces/ActionSet.cs +++ b/StartGG/Client/Generated/Interfaces/ActionSet.cs @@ -5,6 +5,7 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; @@ -13,43 +14,79 @@ namespace StartGG.Client; -public static class ActionSetExtentions +/// +/// Extension methods for ActionSet interface type casting +/// +public static class ActionSetExtensions { - [GraphInterface] + /// + /// Casts ActionSet to TeamActionSet if the runtime type matches + /// + /// The interface value to cast + /// TeamActionSet instance or null if type doesn't match + [GraphQLMember("TeamActionSet", true)] public static TeamActionSet TeamActionSet(this ActionSet value) { if (value.__TypeName == "TeamActionSet") { return (TeamActionSet)value; } - return null; } + } +/// +/// JSON converter for ActionSet interface deserialization +/// internal class ActionSetConverter : InterfaceJsonConverter { - public override ActionSet Deserialize(string typeName, JsonObject json) + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type + public override ActionSet Deserialize(string typeName, JsonObject json) => typeName switch { - return typeName switch - { - "TeamActionSet" => json.Deserialize(), - _ => json.Deserialize() - }; - } + "TeamActionSet" => json.Deserialize(), + _ => json.Deserialize() + }; } +/// +/// GraphQL interface ActionSet with all common fields +/// [JsonConverter(typeof(ActionSetConverter))] -public interface ActionSet +public interface ActionSet { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + ID Id { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + string __TypeName { get; set; } } +/// +/// Concrete implementation of ActionSet interface for fallback deserialization +/// internal class ActionSet__Concrete : ActionSet { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + public ID Id { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + public string __TypeName { get; set; } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Interfaces/BracketConfig.cs b/StartGG/Client/Generated/Interfaces/BracketConfig.cs index dd607ef2..48cf5354 100644 --- a/StartGG/Client/Generated/Interfaces/BracketConfig.cs +++ b/StartGG/Client/Generated/Interfaces/BracketConfig.cs @@ -5,6 +5,7 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; @@ -13,47 +14,91 @@ namespace StartGG.Client; -public static class BracketConfigExtentions +/// +/// Extension methods for BracketConfig interface type casting +/// +public static class BracketConfigExtensions { - [GraphInterface] + /// + /// Casts BracketConfig to RaceBracketConfig if the runtime type matches + /// + /// The interface value to cast + /// RaceBracketConfig instance or null if type doesn't match + [GraphQLMember("RaceBracketConfig", true)] public static RaceBracketConfig RaceBracketConfig(this BracketConfig value) { if (value.__TypeName == "RaceBracketConfig") { return (RaceBracketConfig)value; } - return null; } + } +/// +/// JSON converter for BracketConfig interface deserialization +/// internal class BracketConfigConverter : InterfaceJsonConverter { - public override BracketConfig Deserialize(string typeName, JsonObject json) + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type + public override BracketConfig Deserialize(string typeName, JsonObject json) => typeName switch { - return typeName switch - { - "RaceBracketConfig" => json.Deserialize(), - _ => json.Deserialize() - }; - } + "RaceBracketConfig" => json.Deserialize(), + _ => json.Deserialize() + }; } +/// +/// GraphQL interface BracketConfig with all common fields +/// [JsonConverter(typeof(BracketConfigConverter))] -public interface BracketConfig +public interface BracketConfig { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + ID Id { get; set; } - [GraphQLMember("bracketType")] public BracketType? BracketType { get; set; } + /// + /// bracketType field from GraphQL schema + /// + [GraphQLMember("bracketType")] + BracketType? BracketType { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + string __TypeName { get; set; } } +/// +/// Concrete implementation of BracketConfig interface for fallback deserialization +/// internal class BracketConfig__Concrete : BracketConfig { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + public ID Id { get; set; } - [GraphQLMember("bracketType")] public BracketType? BracketType { get; set; } + /// + /// bracketType field from GraphQL schema + /// + [GraphQLMember("bracketType")] + public BracketType? BracketType { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + public string __TypeName { get; set; } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Interfaces/IMutationMethods.cs b/StartGG/Client/Generated/Interfaces/IMutationMethods.cs new file mode 100644 index 00000000..a88f3772 --- /dev/null +++ b/StartGG/Client/Generated/Interfaces/IMutationMethods.cs @@ -0,0 +1,159 @@ +//--------------------------------------------------------------------- +// 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 Linq2GraphQL.Client; + +namespace StartGG.Client; + +/// +/// Interface for MutationMethods GraphQL operations +/// +public interface IMutationMethods +{ + /// + /// Executes assignStation GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery AssignStation(ID setId, ID stationId); + + /// + /// Executes assignStream GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery AssignStream(ID setId, ID streamId); + + /// + /// Executes deletePhase GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery DeletePhase(ID phaseId); + + /// + /// Executes deleteStation GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery DeleteStation(ID stationId); + + /// + /// Executes deleteWave GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery DeleteWave(ID waveId); + + /// + /// Executes generateRegistrationToken GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery GenerateRegistrationToken(TournamentRegistrationInput registration, ID userId); + + /// + /// Executes markSetCalled GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery MarkSetCalled(ID setId); + + /// + /// Executes markSetInProgress GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery MarkSetInProgress(ID setId); + + /// + /// Executes registerForTournament GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery RegisterForTournament(TournamentRegistrationInput registration = null, string registrationToken = null); + + /// + /// Executes reportBracketSet GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery> + GraphQuery> ReportBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, List gameData = null); + + /// + /// Executes resetSet GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery ResetSet(ID setId, bool? resetDependentSets = null); + + /// + /// Executes resolveScheduleConflicts GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery> + GraphQuery> ResolveScheduleConflicts(ID tournamentId, ResolveConflictsOptions options = null); + + /// + /// Executes swapSeeds GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery> + GraphQuery> SwapSeeds(ID phaseId, ID seed1Id, ID seed2Id); + + /// + /// Executes updateBracketSet GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpdateBracketSet(ID setId, ID winnerId = null, bool? isDQ = null, List gameData = null); + + /// + /// Executes updatePhaseGroups GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery> + GraphQuery> UpdatePhaseGroups(List groupConfigs); + + /// + /// Executes updatePhaseSeeding GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpdatePhaseSeeding(ID phaseId, List seedMapping, UpdatePhaseSeedingOptions options = null); + + /// + /// Executes updateVodUrl GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpdateVodUrl(ID setId, string vodUrl = null); + + /// + /// Executes upsertPhase GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpsertPhase(PhaseUpsertInput payload, ID phaseId = null, ID eventId = null); + + /// + /// Executes upsertStation GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpsertStation(StationUpsertInput fields, ID stationId = null, ID tournamentId = null); + + /// + /// Executes upsertWave GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery UpsertWave(WaveUpsertInput fields, ID waveId = null, ID tournamentId = null); + +} diff --git a/StartGG/Client/Generated/Interfaces/IQueryMethods.cs b/StartGG/Client/Generated/Interfaces/IQueryMethods.cs new file mode 100644 index 00000000..993a0898 --- /dev/null +++ b/StartGG/Client/Generated/Interfaces/IQueryMethods.cs @@ -0,0 +1,159 @@ +//--------------------------------------------------------------------- +// 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 Linq2GraphQL.Client; + +namespace StartGG.Client; + +/// +/// Interface for QueryMethods GraphQL operations +/// +public interface IQueryMethods +{ + /// + /// Executes currentUser GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery CurrentUser(); + + /// + /// Executes entrant GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Entrant(ID id); + + /// + /// Executes event GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Event(ID id = null, string slug = null); + + /// + /// Executes league GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery League(ID id = null, string slug = null); + + /// + /// Executes leagues GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Leagues(LeagueQuery query); + + /// + /// Executes participant GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Participant(ID id, bool? isAdmin = null); + + /// + /// Executes phase GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Phase(ID id = null); + + /// + /// Executes phaseGroup GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery PhaseGroup(ID id = null); + + /// + /// Executes player GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Player(ID id); + + /// + /// Executes seed GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Seed(ID id = null); + + /// + /// Executes set GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Set(ID id); + + /// + /// Executes shop GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Shop(ID id = null, string slug = null); + + /// + /// Executes stream GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Stream(ID id); + + /// + /// Executes streamQueue GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery> + GraphQuery> StreamQueue(ID tournamentId, bool? includePlayerStreams = null); + + /// + /// Executes team GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Team(ID id = null, string slug = null, string inviteCode = null); + + /// + /// Executes tournament GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Tournament(ID id = null, string slug = null); + + /// + /// Executes tournaments GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Tournaments(TournamentQuery query); + + /// + /// Executes user GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery User(ID id = null, string slug = null); + + /// + /// Executes videogame GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Videogame(ID id = null, string slug = null); + + /// + /// Executes videogames GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Videogames(VideogameQuery query); + +} diff --git a/test/Linq2GraphQL.TestClient/Generated/Scalars/LocalTime.cs b/StartGG/Client/Generated/Interfaces/IStartGGClient.cs similarity index 51% rename from test/Linq2GraphQL.TestClient/Generated/Scalars/LocalTime.cs rename to StartGG/Client/Generated/Interfaces/IStartGGClient.cs index f7067645..eb0c770e 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Scalars/LocalTime.cs +++ b/StartGG/Client/Generated/Interfaces/IStartGGClient.cs @@ -5,14 +5,12 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- - using Linq2GraphQL.Client; -using System.Text.Json.Serialization; -namespace Linq2GraphQL.TestClient; +namespace StartGG.Client; - /// - /// The LocalTime scalar type is a local time string (i.e., with no associated timezone) in 24-hr HH:mm:ss. - /// - [JsonConverter(typeof(CustomScalarConverter))] - public partial class LocalTime : CustomScalar {} \ No newline at end of file +public interface IStartGGClient +{ + IQueryMethods Query { get; } + IMutationMethods Mutation { get; } +} diff --git a/StartGG/Client/Generated/Interfaces/MatchConfig.cs b/StartGG/Client/Generated/Interfaces/MatchConfig.cs index 038d2adc..049ee88a 100644 --- a/StartGG/Client/Generated/Interfaces/MatchConfig.cs +++ b/StartGG/Client/Generated/Interfaces/MatchConfig.cs @@ -5,6 +5,7 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; @@ -13,47 +14,91 @@ namespace StartGG.Client; -public static class MatchConfigExtentions +/// +/// Extension methods for MatchConfig interface type casting +/// +public static class MatchConfigExtensions { - [GraphInterface] + /// + /// Casts MatchConfig to RaceMatchConfig if the runtime type matches + /// + /// The interface value to cast + /// RaceMatchConfig instance or null if type doesn't match + [GraphQLMember("RaceMatchConfig", true)] public static RaceMatchConfig RaceMatchConfig(this MatchConfig value) { if (value.__TypeName == "RaceMatchConfig") { return (RaceMatchConfig)value; } - return null; } + } +/// +/// JSON converter for MatchConfig interface deserialization +/// internal class MatchConfigConverter : InterfaceJsonConverter { - public override MatchConfig Deserialize(string typeName, JsonObject json) + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type + public override MatchConfig Deserialize(string typeName, JsonObject json) => typeName switch { - return typeName switch - { - "RaceMatchConfig" => json.Deserialize(), - _ => json.Deserialize() - }; - } + "RaceMatchConfig" => json.Deserialize(), + _ => json.Deserialize() + }; } +/// +/// GraphQL interface MatchConfig with all common fields +/// [JsonConverter(typeof(MatchConfigConverter))] -public interface MatchConfig +public interface MatchConfig { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + ID Id { get; set; } - [GraphQLMember("bracketType")] public BracketType? BracketType { get; set; } + /// + /// bracketType field from GraphQL schema + /// + [GraphQLMember("bracketType")] + BracketType? BracketType { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + string __TypeName { get; set; } } +/// +/// Concrete implementation of MatchConfig interface for fallback deserialization +/// internal class MatchConfig__Concrete : MatchConfig { - [GraphQLMember("id")] public ID Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + public ID Id { get; set; } - [GraphQLMember("bracketType")] public BracketType? BracketType { get; set; } + /// + /// bracketType field from GraphQL schema + /// + [GraphQLMember("bracketType")] + public BracketType? BracketType { get; set; } - [GraphQLMember("__typename")] public string __TypeName { get; set; } + /// + /// GraphQL __typename field for runtime type resolution + /// + [GraphQLMember("__typename")] + public string __TypeName { get; set; } } \ No newline at end of file diff --git a/StartGG/Client/Generated/Interfaces/Team.cs b/StartGG/Client/Generated/Interfaces/Team.cs index 3f33e710..4b5805b6 100644 --- a/StartGG/Client/Generated/Interfaces/Team.cs +++ b/StartGG/Client/Generated/Interfaces/Team.cs @@ -14,11 +14,17 @@ namespace StartGG.Client; -public static class TeamExtentions +/// +/// Extension methods for Team interface type casting +/// +public static class TeamExtensions { - - - [GraphInterface] + /// + /// Casts Team to EventTeam if the runtime type matches + /// + /// The interface value to cast + /// EventTeam instance or null if type doesn't match + [GraphQLMember("EventTeam", true)] public static EventTeam EventTeam(this Team value) { if (value.__TypeName == "EventTeam") @@ -28,7 +34,12 @@ public static EventTeam EventTeam(this Team value) return null; } - [GraphInterface] + /// + /// Casts Team to GlobalTeam if the runtime type matches + /// + /// The interface value to cast + /// GlobalTeam instance or null if type doesn't match + [GraphQLMember("GlobalTeam", true)] public static GlobalTeam GlobalTeam(this Team value) { if (value.__TypeName == "GlobalTeam") @@ -37,54 +48,109 @@ public static GlobalTeam GlobalTeam(this Team value) } return null; } -} +} +/// +/// JSON converter for Team interface deserialization +/// internal class TeamConverter : InterfaceJsonConverter { + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type public override Team Deserialize(string typeName, JsonObject json) => typeName switch { - "EventTeam" => json.Deserialize(), - "GlobalTeam" => json.Deserialize(), - _ => json.Deserialize< Team__Concrete>() + "EventTeam" => json.Deserialize(), + "GlobalTeam" => json.Deserialize(), + _ => json.Deserialize() }; } - - - +/// +/// GraphQL interface Team with all common fields +/// [JsonConverter(typeof(TeamConverter))] public interface Team { - [GraphQLMember("id")] - public ID Id { get; set; } - [GraphQLMember("discriminator")] - public string Discriminator { get; set; } - [GraphQLMember("images")] - public List Images { get; } - [GraphQLMember("members")] - public List Members { get; } - [GraphQLMember("name")] - public string Name { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + ID Id { get; set; } + + /// + /// discriminator field from GraphQL schema + /// + [GraphQLMember("discriminator")] + string Discriminator { get; set; } + + /// + /// images field from GraphQL schema + /// + [GraphQLMember("images")] + List Images { get; set; } + + /// + /// members field from GraphQL schema + /// + [GraphQLMember("members")] + List Members { get; set; } + + /// + /// name field from GraphQL schema + /// + [GraphQLMember("name")] + string Name { get; set; } + + /// + /// GraphQL __typename field for runtime type resolution + /// [GraphQLMember("__typename")] - public string __TypeName { get; set; } - + string __TypeName { get; set; } } +/// +/// Concrete implementation of Team interface for fallback deserialization +/// internal class Team__Concrete : Team { - [GraphQLMember("id")] - public ID Id { get; set; } - [GraphQLMember("discriminator")] - public string Discriminator { get; set; } - [GraphQLMember("images")] - public List Images { get; set; } - [GraphQLMember("members")] - public List Members { get; set; } - [GraphQLMember("name")] - public string Name { get; set; } - + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + public ID Id { get; set; } + + /// + /// discriminator field from GraphQL schema + /// + [GraphQLMember("discriminator")] + public string Discriminator { get; set; } + + /// + /// images field from GraphQL schema + /// + [GraphQLMember("images")] + public List Images { get; set; } + + /// + /// members field from GraphQL schema + /// + [GraphQLMember("members")] + public List Members { get; set; } + + /// + /// name field from GraphQL schema + /// + [GraphQLMember("name")] + public string Name { get; set; } + + /// + /// GraphQL __typename field for runtime type resolution + /// [GraphQLMember("__typename")] public string __TypeName { get; set; } - } \ No newline at end of file diff --git a/StartGG/Client/Generated/Scalars/ID.cs b/StartGG/Client/Generated/Scalars/ID.cs index 3f303b56..8b38c077 100644 --- a/StartGG/Client/Generated/Scalars/ID.cs +++ b/StartGG/Client/Generated/Scalars/ID.cs @@ -6,17 +6,15 @@ //--------------------------------------------------------------------- -using System.Text.Json.Serialization; using Linq2GraphQL.Client; +using System.Text.Json.Serialization; namespace StartGG.Client; -/// -/// The `ID` scalar type represents a unique identifier, often used to -/// refetch an object or as key for a cache. When expected as an input type, any string (such as `"4"`) or integer -/// (such as `4`) input value will be accepted as an ID. -/// -[JsonConverter(typeof(CustomScalarConverter))] -public class ID : CustomScalar -{ -} \ No newline at end of file + /// + /// The `ID` scalar type represents a unique identifier, often used to +/// refetch an object or as key for a cache. When expected as an input type, any string (such as `"4"`) or integer +/// (such as `4`) input value will be accepted as an ID. + /// + [JsonConverter(typeof(CustomScalarConverter))] + public partial class ID : CustomScalar {} \ No newline at end of file diff --git a/StartGG/Client/Generated/Scalars/JSON.cs b/StartGG/Client/Generated/Scalars/JSON.cs index b61c5763..947223de 100644 --- a/StartGG/Client/Generated/Scalars/JSON.cs +++ b/StartGG/Client/Generated/Scalars/JSON.cs @@ -6,16 +6,14 @@ //--------------------------------------------------------------------- -using System.Text.Json.Serialization; using Linq2GraphQL.Client; +using System.Text.Json.Serialization; namespace StartGG.Client; -/// -/// The `JSON` scalar type represents JSON values as specified by -/// [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). -/// -[JsonConverter(typeof(CustomScalarConverter))] -public class JSON : CustomScalar -{ -} \ No newline at end of file + /// + /// The `JSON` scalar type represents JSON values as specified by +/// [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). + /// + [JsonConverter(typeof(CustomScalarConverter))] + public partial class JSON : CustomScalar {} \ No newline at end of file diff --git a/StartGG/Client/Generated/Scalars/Timestamp.cs b/StartGG/Client/Generated/Scalars/Timestamp.cs index e1da00f5..13555198 100644 --- a/StartGG/Client/Generated/Scalars/Timestamp.cs +++ b/StartGG/Client/Generated/Scalars/Timestamp.cs @@ -6,16 +6,14 @@ //--------------------------------------------------------------------- -using System.Text.Json.Serialization; using Linq2GraphQL.Client; +using System.Text.Json.Serialization; namespace StartGG.Client; -/// -/// Represents a Unix Timestamp. Supports up to 53 bit int values, -/// as that is JavaScript's internal memory allocation for integer values. -/// -[JsonConverter(typeof(CustomScalarConverter))] -public class Timestamp : CustomScalar -{ -} \ No newline at end of file + /// + /// Represents a Unix Timestamp. Supports up to 53 bit int values, +/// as that is JavaScript's internal memory allocation for integer values. + /// + [JsonConverter(typeof(CustomScalarConverter))] + public partial class Timestamp : CustomScalar {} \ No newline at end of file diff --git a/StartGG/Client/Generated/Types/Address.cs b/StartGG/Client/Generated/Types/Address.cs index b67b73b5..e3e765cd 100644 --- a/StartGG/Client/Generated/Types/Address.cs +++ b/StartGG/Client/Generated/Types/Address.cs @@ -5,16 +5,19 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// A user's address +/// A user's address /// -public class Address : GraphQLTypeBase +public partial class Address : GraphQLTypeBase { [GraphQLMember("id")] [JsonPropertyName("id")] @@ -39,4 +42,5 @@ public class Address : GraphQLTypeBase [GraphQLMember("stateId")] [JsonPropertyName("stateId")] public int? StateId { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/ContactInfo.cs b/StartGG/Client/Generated/Types/ContactInfo.cs index b70175c5..cc5b37d1 100644 --- a/StartGG/Client/Generated/Types/ContactInfo.cs +++ b/StartGG/Client/Generated/Types/ContactInfo.cs @@ -5,37 +5,40 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// Name, address, etc +/// Name, address, etc /// -public class ContactInfo : GraphQLTypeBase +public partial class ContactInfo : GraphQLTypeBase { [GraphQLMember("id")] [JsonPropertyName("id")] public ID Id { get; set; } /// - /// Participant City Name + /// Participant City Name /// [GraphQLMember("city")] [JsonPropertyName("city")] public string City { get; set; } /// - /// Participant Country Name + /// Participant Country Name /// [GraphQLMember("country")] [JsonPropertyName("country")] public string Country { get; set; } /// - /// Participant Country (region) id + /// Participant Country (region) id /// [GraphQLMember("countryId")] [JsonPropertyName("countryId")] @@ -46,37 +49,38 @@ public class ContactInfo : GraphQLTypeBase public string Name { get; set; } /// - /// First Name + /// First Name /// [GraphQLMember("nameFirst")] [JsonPropertyName("nameFirst")] public string NameFirst { get; set; } /// - /// Last Name + /// Last Name /// [GraphQLMember("nameLast")] [JsonPropertyName("nameLast")] public string NameLast { get; set; } /// - /// Participant State Name + /// Participant State Name /// [GraphQLMember("state")] [JsonPropertyName("state")] public string State { get; set; } /// - /// Participant State (region) id + /// Participant State (region) id /// [GraphQLMember("stateId")] [JsonPropertyName("stateId")] public int? StateId { get; set; } /// - /// Zip or Postal Code + /// Zip or Postal Code /// [GraphQLMember("zipcode")] [JsonPropertyName("zipcode")] public string Zipcode { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/EntrantConnection.cs b/StartGG/Client/Generated/Types/EntrantConnection.cs index 3b590c74..f7dc74fb 100644 --- a/StartGG/Client/Generated/Types/EntrantConnection.cs +++ b/StartGG/Client/Generated/Types/EntrantConnection.cs @@ -5,19 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; -public class EntrantConnection : GraphQLTypeBase, ICursorPaging + +public partial class EntrantConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + [GraphQLMember("nodes")] [JsonPropertyName("nodes")] public List Nodes { get; set; } - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/Client/Generated/Types/Event.cs b/StartGG/Client/Generated/Types/Event.cs index dce295be..4da63331 100644 --- a/StartGG/Client/Generated/Types/Event.cs +++ b/StartGG/Client/Generated/Types/Event.cs @@ -123,6 +123,13 @@ public partial class Event : GraphQLTypeBase /// public EntrantConnection Entrants => _entrants.Value(() => GetFirstMethodValue("entrants")); + /// + /// How much it costs to enter this event + /// + [GraphQLMember("entryFee")] + [JsonPropertyName("entryFee")] + public double? EntryFee { get; set; } + /// /// Whether the event has decks /// diff --git a/StartGG/Client/Generated/Types/EventTeam.cs b/StartGG/Client/Generated/Types/EventTeam.cs index 905a939b..8dedba7a 100644 --- a/StartGG/Client/Generated/Types/EventTeam.cs +++ b/StartGG/Client/Generated/Types/EventTeam.cs @@ -69,4 +69,6 @@ public partial class EventTeam : GraphQLTypeBase, Team [GraphQLMember("__typename")] [JsonPropertyName("__typename")] public string __TypeName { get; set; } + List Team.Images { get => Images; set => throw new NotImplementedException(); } + List Team.Members { get => Members; set => throw new NotImplementedException(); } } diff --git a/StartGG/Client/Generated/Types/GlobalTeam.cs b/StartGG/Client/Generated/Types/GlobalTeam.cs index 29b81138..6b4e503a 100644 --- a/StartGG/Client/Generated/Types/GlobalTeam.cs +++ b/StartGG/Client/Generated/Types/GlobalTeam.cs @@ -89,4 +89,6 @@ public partial class GlobalTeam : GraphQLTypeBase, Team [GraphQLMember("__typename")] [JsonPropertyName("__typename")] public string __TypeName { get; set; } + List Team.Images { get => Images; set => throw new NotImplementedException(); } + List Team.Members { get => Members; set => throw new NotImplementedException(); } } diff --git a/StartGG/Client/Generated/Types/Phase.cs b/StartGG/Client/Generated/Types/Phase.cs index 13bca5c4..31a089c8 100644 --- a/StartGG/Client/Generated/Types/Phase.cs +++ b/StartGG/Client/Generated/Types/Phase.cs @@ -5,121 +5,129 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + public static class PhaseExtensions { [GraphQLMember("phaseGroups")] - public static PhaseGroupConnection PhaseGroups(this Phase phase, - [GraphQLArgument("query", "PhaseGroupPageQuery")] PhaseGroupPageQuery query = null) + public static PhaseGroupConnection PhaseGroups(this Phase phase, [GraphQLArgument("query", "PhaseGroupPageQuery")] PhaseGroupPageQuery query = null) { return phase.GetMethodValue("phaseGroups", query); } [GraphQLMember("seeds")] - public static SeedConnection Seeds(this Phase phase, - [GraphQLArgument("query", "SeedPaginationQuery!")] SeedPaginationQuery query, - [GraphQLArgument("eventId", "ID")] ID eventId = null) + public static SeedConnection Seeds(this Phase phase, [GraphQLArgument("query", "SeedPaginationQuery!")] SeedPaginationQuery query, [GraphQLArgument("eventId", "ID")] ID eventId = null) { return phase.GetMethodValue("seeds", query, eventId); } [GraphQLMember("sets")] - public static SetConnection Sets(this Phase phase, [GraphQLArgument("page", "Int")] int? page = null, - [GraphQLArgument("perPage", "Int")] int? perPage = null, - [GraphQLArgument("sortType", "SetSortType")] SetSortType? sortType = null, - [GraphQLArgument("filters", "SetFilters")] SetFilters filters = null) + public static SetConnection Sets(this Phase phase, [GraphQLArgument("page", "Int")] int? page = null, [GraphQLArgument("perPage", "Int")] int? perPage = null, [GraphQLArgument("sortType", "SetSortType")] SetSortType? sortType = null, [GraphQLArgument("filters", "SetFilters")] SetFilters filters = null) { return phase.GetMethodValue("sets", page, perPage, sortType, filters); } + } /// -/// A phase in an event +/// A phase in an event /// -public class Phase : GraphQLTypeBase +public partial class Phase : GraphQLTypeBase { - private readonly LazyProperty _phaseGroups = new(); - - private readonly LazyProperty _seeds = new(); - - private readonly LazyProperty _sets = new(); - [GraphQLMember("id")] [JsonPropertyName("id")] public ID Id { get; set; } /// - /// The bracket type of this phase. + /// The bracket type of this phase. /// [GraphQLMember("bracketType")] [JsonPropertyName("bracketType")] public BracketType? BracketType { get; set; } /// - /// The Event that this phase belongs to + /// The Event that this phase belongs to /// [GraphQLMember("event")] [JsonPropertyName("event")] public Event Event { get; set; } /// - /// Number of phase groups in this phase + /// Number of phase groups in this phase /// [GraphQLMember("groupCount")] [JsonPropertyName("groupCount")] public int? GroupCount { get; set; } /// - /// Is the phase an exhibition or not. + /// Is the phase an exhibition or not. /// [GraphQLMember("isExhibition")] [JsonPropertyName("isExhibition")] public bool? IsExhibition { get; set; } /// - /// Name of phase e.g. Round 1 Pools + /// Name of phase e.g. Round 1 Pools /// [GraphQLMember("name")] [JsonPropertyName("name")] public string Name { get; set; } /// - /// The number of seeds this phase contains. + /// The number of seeds this phase contains. /// [GraphQLMember("numSeeds")] [JsonPropertyName("numSeeds")] public int? NumSeeds { get; set; } + private LazyProperty _phaseGroups = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// - public PhaseGroupConnection PhaseGroups => - _phaseGroups.Value(() => GetFirstMethodValue("phaseGroups")); + public PhaseGroupConnection PhaseGroups => _phaseGroups.Value(() => GetFirstMethodValue("phaseGroups")); /// - /// The relative order of this phase within an event + /// The relative order of this phase within an event /// [GraphQLMember("phaseOrder")] [JsonPropertyName("phaseOrder")] public int? PhaseOrder { get; set; } /// - /// Do not use in Query, only to retrive result + /// Information about the progressions into this phase + /// + [GraphQLMember("progressingInData")] + [JsonPropertyName("progressingInData")] + public List ProgressingInData { get; set; } + + /// + /// Information about the progressions out of this phase + /// + [GraphQLMember("progressions")] + [JsonPropertyName("progressions")] + public List Progressions { get; set; } + + private LazyProperty _seeds = new(); + /// + /// Do not use in Query, only to retrive result /// public SeedConnection Seeds => _seeds.Value(() => GetFirstMethodValue("seeds")); + private LazyProperty _sets = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public SetConnection Sets => _sets.Value(() => GetFirstMethodValue("sets")); /// - /// State of the phase + /// State of the phase /// [GraphQLMember("state")] [JsonPropertyName("state")] @@ -128,4 +136,5 @@ public class Phase : GraphQLTypeBase [GraphQLMember("waves")] [JsonPropertyName("waves")] public List Waves { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/Progression.cs b/StartGG/Client/Generated/Types/Progression.cs index 859a780a..15ca90f5 100644 --- a/StartGG/Client/Generated/Types/Progression.cs +++ b/StartGG/Client/Generated/Types/Progression.cs @@ -39,4 +39,8 @@ public partial class Progression : GraphQLTypeBase [JsonPropertyName("originPlacement")] public int? OriginPlacement { get; set; } + [GraphQLMember("placeholderName")] + [JsonPropertyName("placeholderName")] + public string PlaceholderName { get; set; } + } diff --git a/test/Linq2GraphQL.TestClient/Generated/Types/OrdersOffsetPagingCollectionSegment.cs b/StartGG/Client/Generated/Types/ProgressionData.cs similarity index 51% rename from test/Linq2GraphQL.TestClient/Generated/Types/OrdersOffsetPagingCollectionSegment.cs rename to StartGG/Client/Generated/Types/ProgressionData.cs index b79f7891..5da8d6dd 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Types/OrdersOffsetPagingCollectionSegment.cs +++ b/StartGG/Client/Generated/Types/ProgressionData.cs @@ -11,30 +11,26 @@ using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; -namespace Linq2GraphQL.TestClient; +namespace StartGG.Client; /// -/// A segment of a collection. +/// Data on phase progression, keyed on destination PhaseId /// -public partial class OrdersOffsetPagingCollectionSegment : GraphQLTypeBase +public partial class ProgressionData : GraphQLTypeBase { /// - /// Information to aid in pagination. + /// Origin phase ID that is the source of this progression. /// - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public CollectionSegmentInfo PageInfo { get; set; } + [GraphQLMember("origin")] + [JsonPropertyName("origin")] + public int? Origin { get; set; } /// - /// A flattened list of the items. + /// Amount of seeds per phase group that are progressing. /// - [GraphQLMember("items")] - [JsonPropertyName("items")] - public List Items { get; set; } - - [GraphQLMember("totalCount")] - [JsonPropertyName("totalCount")] - public int TotalCount { get; set; } + [GraphQLMember("numProgressing")] + [JsonPropertyName("numProgressing")] + public int? NumProgressing { get; set; } } diff --git a/StartGG/Client/Generated/Types/RaceMatchConfig.cs b/StartGG/Client/Generated/Types/RaceMatchConfig.cs index d6644dd1..c9218172 100644 --- a/StartGG/Client/Generated/Types/RaceMatchConfig.cs +++ b/StartGG/Client/Generated/Types/RaceMatchConfig.cs @@ -5,47 +5,50 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// Race specific match configuration +/// Race specific match configuration /// -public class RaceMatchConfig : GraphQLTypeBase, MatchConfig +public partial class RaceMatchConfig : GraphQLTypeBase, MatchConfig { + [GraphQLMember("id")] + [JsonPropertyName("id")] + public ID Id { get; set; } + + [GraphQLMember("bracketType")] + [JsonPropertyName("bracketType")] + public BracketType? BracketType { get; set; } + /// - /// Can players report results? + /// Can players report results? /// [GraphQLMember("playerReportingEnabled")] [JsonPropertyName("playerReportingEnabled")] public bool? PlayerReportingEnabled { get; set; } /// - /// Accepted methods of verification that players can use + /// Accepted methods of verification that players can use /// [GraphQLMember("verificationMethods")] [JsonPropertyName("verificationMethods")] public List VerificationMethods { get; set; } /// - /// Are players required to submit verification of their reported results? + /// Are players required to submit verification of their reported results? /// [GraphQLMember("verificationRequired")] [JsonPropertyName("verificationRequired")] public bool? VerificationRequired { get; set; } - [GraphQLMember("id")] - [JsonPropertyName("id")] - public ID Id { get; set; } - - [GraphQLMember("bracketType")] - [JsonPropertyName("bracketType")] - public BracketType? BracketType { get; set; } - [GraphQLMember("__typename")] [JsonPropertyName("__typename")] public string __TypeName { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/Client/Generated/Types/Set.cs b/StartGG/Client/Generated/Types/Set.cs index 40973fab..8c89d4cb 100644 --- a/StartGG/Client/Generated/Types/Set.cs +++ b/StartGG/Client/Generated/Types/Set.cs @@ -5,92 +5,103 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + public static class SetExtensions { [GraphQLMember("displayScore")] - public static string DisplayScore(this Set set, [GraphQLArgument("mainEntrantId", "ID")] ID mainEntrantId = null) + public static string DisplayScore(this Set set, [GraphQLArgument("mainEntrantId", "ID")] ID mainEntrantId = null) { return set.GetMethodValue("displayScore", mainEntrantId); } [GraphQLMember("game")] - public static Game Game(this Set set, [GraphQLArgument("orderNum", "Int!")] int orderNum) + public static Game Game(this Set set, [GraphQLArgument("orderNum", "Int!")] int orderNum) { return set.GetMethodValue("game", orderNum); } [GraphQLMember("images")] - public static List Images(this Set set, [GraphQLArgument("type", "String")] string type = null) + public static List Images(this Set set, [GraphQLArgument("type", "String")] string type = null) { return set.GetMethodValue>("images", type); } [GraphQLMember("slots")] - public static List Slots(this Set set, - [GraphQLArgument("includeByes", "Boolean")] bool? includeByes = null) + public static List Slots(this Set set, [GraphQLArgument("includeByes", "Boolean")] bool? includeByes = null) { return set.GetMethodValue>("slots", includeByes); } + } /// -/// A set +/// A set /// -public class Set : GraphQLTypeBase +public partial class Set : GraphQLTypeBase { - private readonly LazyProperty _displayScore = new(); - - private readonly LazyProperty _game = new(); - - private readonly LazyProperty> _images = new(); - - private readonly LazyProperty> _slots = new(); - [GraphQLMember("id")] [JsonPropertyName("id")] public ID Id { get; set; } /// - /// The time this set was marked as completed + /// The time this set was marked as completed /// [GraphQLMember("completedAt")] [JsonPropertyName("completedAt")] public Timestamp CompletedAt { get; set; } /// - /// The time this set was created + /// The time this set was created /// [GraphQLMember("createdAt")] [JsonPropertyName("createdAt")] public Timestamp CreatedAt { get; set; } + private LazyProperty _displayScore = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public string DisplayScore => _displayScore.Value(() => GetFirstMethodValue("displayScore")); /// - /// Event that this set belongs to. + /// The source of the first entrant in this set + /// + [GraphQLMember("entrant1Source")] + [JsonPropertyName("entrant1Source")] + public SetEntrantSource Entrant1Source { get; set; } + + /// + /// The source of the second entrant in this set + /// + [GraphQLMember("entrant2Source")] + [JsonPropertyName("entrant2Source")] + public SetEntrantSource Entrant2Source { get; set; } + + /// + /// Event that this set belongs to. /// [GraphQLMember("event")] [JsonPropertyName("event")] public Event Event { get; set; } /// - /// Full round text of this set. + /// Full round text of this set. /// [GraphQLMember("fullRoundText")] [JsonPropertyName("fullRoundText")] public string FullRoundText { get; set; } + private LazyProperty _game = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public Game Game => _game.Value(() => GetFirstMethodValue("game")); @@ -99,21 +110,22 @@ public class Set : GraphQLTypeBase public List Games { get; set; } /// - /// Whether this set contains a placeholder entrant + /// Whether this set contains a placeholder entrant /// [GraphQLMember("hasPlaceholder")] [JsonPropertyName("hasPlaceholder")] public bool? HasPlaceholder { get; set; } /// - /// The letters that describe a unique identifier within the pool. Eg. F, AT + /// The letters that describe a unique identifier within the pool. Eg. F, AT /// [GraphQLMember("identifier")] [JsonPropertyName("identifier")] public string Identifier { get; set; } + private LazyProperty> _images = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public List Images => _images.Value(() => GetFirstMethodValue>("images")); @@ -122,42 +134,49 @@ public class Set : GraphQLTypeBase public int? LPlacement { get; set; } /// - /// Phase group that this Set belongs to. + /// The progression seed that the loser of this set will be placed into (if applicable) + /// + [GraphQLMember("loserProgressionSeed")] + [JsonPropertyName("loserProgressionSeed")] + public Seed LoserProgressionSeed { get; set; } + + /// + /// Phase group that this Set belongs to. /// [GraphQLMember("phaseGroup")] [JsonPropertyName("phaseGroup")] public PhaseGroup PhaseGroup { get; set; } /// - /// The sets that are affected from resetting this set + /// The sets that are affected from resetting this set /// [GraphQLMember("resetAffectedData")] [JsonPropertyName("resetAffectedData")] public ResetAffectedData ResetAffectedData { get; set; } /// - /// The round number of the set. Negative numbers are losers bracket + /// The round number of the set. Negative numbers are losers bracket /// [GraphQLMember("round")] [JsonPropertyName("round")] public int? Round { get; set; } /// - /// Indicates whether the set is in best of or total games mode. This instructs - /// which field is used to figure out how many games are in this set. + /// Indicates whether the set is in best of or total games mode. This instructs +/// which field is used to figure out how many games are in this set. /// [GraphQLMember("setGamesType")] [JsonPropertyName("setGamesType")] public int? SetGamesType { get; set; } + private LazyProperty> _slots = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public List Slots => _slots.Value(() => GetFirstMethodValue>("slots")); /// - /// The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds - /// configuration. + /// The start time of the Set. If there is no startAt time on the Set, will pull it from phaseGroup rounds configuration. /// [GraphQLMember("startAt")] [JsonPropertyName("startAt")] @@ -172,28 +191,35 @@ public class Set : GraphQLTypeBase public int? State { get; set; } /// - /// Tournament event station for a set + /// Tournament event station for a set /// [GraphQLMember("station")] [JsonPropertyName("station")] public Stations Station { get; set; } /// - /// Tournament event stream for a set + /// Tournament event stream for a set /// [GraphQLMember("stream")] [JsonPropertyName("stream")] public Streams Stream { get; set; } /// - /// If setGamesType is in total games mode, this defined the number of games in the set. + /// If setGamesType is in total games mode, this defined the number of games in the set. /// [GraphQLMember("totalGames")] [JsonPropertyName("totalGames")] public int? TotalGames { get; set; } /// - /// Url of a VOD for this set + /// The time this set was last updated + /// + [GraphQLMember("updatedAt")] + [JsonPropertyName("updatedAt")] + public Timestamp UpdatedAt { get; set; } + + /// + /// Url of a VOD for this set /// [GraphQLMember("vodUrl")] [JsonPropertyName("vodUrl")] @@ -206,4 +232,12 @@ public class Set : GraphQLTypeBase [GraphQLMember("winnerId")] [JsonPropertyName("winnerId")] public int? WinnerId { get; set; } -} \ No newline at end of file + + /// + /// The progression seed that the winner of this set will be placed into (if applicable) + /// + [GraphQLMember("winnerProgressionSeed")] + [JsonPropertyName("winnerProgressionSeed")] + public Seed WinnerProgressionSeed { get; set; } + +} diff --git a/StartGG/Client/Generated/Types/SetEntrantSource.cs b/StartGG/Client/Generated/Types/SetEntrantSource.cs new file mode 100644 index 00000000..a510f17e --- /dev/null +++ b/StartGG/Client/Generated/Types/SetEntrantSource.cs @@ -0,0 +1,51 @@ +//--------------------------------------------------------------------- +// 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; +using Linq2GraphQL.Client; +using Linq2GraphQL.Client.Common; + +namespace StartGG.Client; + + +/// +/// Describes a source for an entrant in a set. Generally the source is either from +/// a winner/loser of a set in this phase group, or a seed if this is a progression +/// +public partial class SetEntrantSource : GraphQLTypeBase +{ + /// + /// The type of this source. e.g. set, seed + /// + [GraphQLMember("type")] + [JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// The ID of the type of this source. e.g. set ID, seed ID, etc. + /// + [GraphQLMember("typeId")] + [JsonPropertyName("typeId")] + public ID TypeId { get; set; } + + /// + /// The condition of this source. e.g. winner, loser, etc. + /// + [GraphQLMember("condition")] + [JsonPropertyName("condition")] + public string Condition { get; set; } + + /// + /// Human readable string for the condition. e.g. "Winner of Set #1234" or "Seed #1" + /// + [GraphQLMember("conditionString")] + [JsonPropertyName("conditionString")] + public string ConditionString { get; set; } + +} diff --git a/StartGG/Client/Generated/Types/SetSlot.cs b/StartGG/Client/Generated/Types/SetSlot.cs index a9172ee2..6165bbe5 100644 --- a/StartGG/Client/Generated/Types/SetSlot.cs +++ b/StartGG/Client/Generated/Types/SetSlot.cs @@ -5,16 +5,19 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// A slot in a set where a seed currently or will eventually exist in order to participate in the set. +/// A slot in a set where a seed currently or will eventually exist in order to participate in the set. /// -public class SetSlot : GraphQLTypeBase +public partial class SetSlot : GraphQLTypeBase { [GraphQLMember("id")] [JsonPropertyName("id")] @@ -25,21 +28,21 @@ public class SetSlot : GraphQLTypeBase public Entrant Entrant { get; set; } /// - /// Pairs with prereqType, is the ID of the prereq. + /// Pairs with prereqType, is the ID of the prereq. /// [GraphQLMember("prereqId")] [JsonPropertyName("prereqId")] public string PrereqId { get; set; } /// - /// Given a set prereq type, defines the placement required in the origin set to end up in this slot. + /// Given a set prereq type, defines the placement required in the origin set to end up in this slot. /// [GraphQLMember("prereqPlacement")] [JsonPropertyName("prereqPlacement")] public int? PrereqPlacement { get; set; } /// - /// Describes where the entity in this slot comes from. + /// Describes where the entity in this slot comes from. /// [GraphQLMember("prereqType")] [JsonPropertyName("prereqType")] @@ -50,16 +53,17 @@ public class SetSlot : GraphQLTypeBase public Seed Seed { get; set; } /// - /// The index of the slot. Unique per set. + /// The index of the slot. Unique per set. /// [GraphQLMember("slotIndex")] [JsonPropertyName("slotIndex")] public int? SlotIndex { get; set; } /// - /// The standing within this set for the seed currently assigned to this slot. + /// The standing within this set for the seed currently assigned to this slot. /// [GraphQLMember("standing")] [JsonPropertyName("standing")] public Standing Standing { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/ShopLevel.cs b/StartGG/Client/Generated/Types/ShopLevel.cs index 4666af9f..d336f9c3 100644 --- a/StartGG/Client/Generated/Types/ShopLevel.cs +++ b/StartGG/Client/Generated/Types/ShopLevel.cs @@ -5,28 +5,30 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + public static class ShopLevelExtensions { [GraphQLMember("images")] - public static List Images(this ShopLevel shopLevel, [GraphQLArgument("type", "String")] string type = null) + public static List Images(this ShopLevel shopLevel, [GraphQLArgument("type", "String")] string type = null) { return shopLevel.GetMethodValue>("images", type); } + } /// -/// A shop level +/// A shop level /// -public class ShopLevel : GraphQLTypeBase +public partial class ShopLevel : GraphQLTypeBase { - private readonly LazyProperty> _images = new(); - [GraphQLMember("id")] [JsonPropertyName("id")] public ID Id { get; set; } @@ -43,12 +45,14 @@ public class ShopLevel : GraphQLTypeBase [JsonPropertyName("goalAmount")] public double? GoalAmount { get; set; } + private LazyProperty> _images = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public List Images => _images.Value(() => GetFirstMethodValue>("images")); [GraphQLMember("name")] [JsonPropertyName("name")] public string Name { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/ShopOrderMessageConnection.cs b/StartGG/Client/Generated/Types/ShopOrderMessageConnection.cs index a524dd5c..58388535 100644 --- a/StartGG/Client/Generated/Types/ShopOrderMessageConnection.cs +++ b/StartGG/Client/Generated/Types/ShopOrderMessageConnection.cs @@ -5,19 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; -public class ShopOrderMessageConnection : GraphQLTypeBase, ICursorPaging + +public partial class ShopOrderMessageConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + [GraphQLMember("nodes")] [JsonPropertyName("nodes")] public List Nodes { get; set; } - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/Client/Generated/Types/Stations.cs b/StartGG/Client/Generated/Types/Stations.cs index 7c346eee..742cbe4b 100644 --- a/StartGG/Client/Generated/Types/Stations.cs +++ b/StartGG/Client/Generated/Types/Stations.cs @@ -67,6 +67,13 @@ public partial class Stations : GraphQLTypeBase [JsonPropertyName("state")] public int? State { get; set; } + /// + /// Tournament event stream for a station + /// + [GraphQLMember("stream")] + [JsonPropertyName("stream")] + public Streams Stream { get; set; } + [GraphQLMember("updatedAt")] [JsonPropertyName("updatedAt")] public Timestamp UpdatedAt { get; set; } diff --git a/StartGG/Client/Generated/Types/StreamQueue.cs b/StartGG/Client/Generated/Types/StreamQueue.cs index ff76d644..d61fd50e 100644 --- a/StartGG/Client/Generated/Types/StreamQueue.cs +++ b/StartGG/Client/Generated/Types/StreamQueue.cs @@ -5,32 +5,36 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// A Stream queue object +/// A Stream queue object /// -public class StreamQueue : GraphQLTypeBase +public partial class StreamQueue : GraphQLTypeBase { [GraphQLMember("id")] [JsonPropertyName("id")] public string Id { get; set; } /// - /// The sets on the stream + /// The sets on the stream /// [GraphQLMember("sets")] [JsonPropertyName("sets")] public List Sets { get; set; } /// - /// The stream on the queue + /// The stream on the queue /// [GraphQLMember("stream")] [JsonPropertyName("stream")] public Streams Stream { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/Streams.cs b/StartGG/Client/Generated/Types/Streams.cs index 8b2abd01..13ac9d10 100644 --- a/StartGG/Client/Generated/Types/Streams.cs +++ b/StartGG/Client/Generated/Types/Streams.cs @@ -19,14 +19,14 @@ namespace StartGG.Client; /// public partial class Streams : GraphQLTypeBase { - [GraphQLMember("id")] - [JsonPropertyName("id")] - public ID Id { get; set; } - [GraphQLMember("enabled")] [JsonPropertyName("enabled")] public bool? Enabled { get; set; } + [GraphQLMember("id")] + [JsonPropertyName("id")] + public ID Id { get; set; } + [GraphQLMember("followerCount")] [JsonPropertyName("followerCount")] public int? FollowerCount { get; set; } @@ -43,6 +43,10 @@ public partial class Streams : GraphQLTypeBase [JsonPropertyName("parentStreamId")] public int? ParentStreamId { get; set; } + [GraphQLMember("shortName")] + [JsonPropertyName("shortName")] + public string ShortName { get; set; } + [GraphQLMember("streamGame")] [JsonPropertyName("streamGame")] public string StreamGame { get; set; } diff --git a/StartGG/Client/Generated/Types/TeamActionSet.cs b/StartGG/Client/Generated/Types/TeamActionSet.cs index 54aa6db2..25496765 100644 --- a/StartGG/Client/Generated/Types/TeamActionSet.cs +++ b/StartGG/Client/Generated/Types/TeamActionSet.cs @@ -5,16 +5,19 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + /// -/// A set of actions available for a team to take +/// A set of actions available for a team to take /// -public class TeamActionSet : GraphQLTypeBase, ActionSet +public partial class TeamActionSet : GraphQLTypeBase, ActionSet { [GraphQLMember("id")] [JsonPropertyName("id")] @@ -23,4 +26,4 @@ public class TeamActionSet : GraphQLTypeBase, ActionSet [GraphQLMember("__typename")] [JsonPropertyName("__typename")] public string __TypeName { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/Client/Generated/Types/TournamentConnection.cs b/StartGG/Client/Generated/Types/TournamentConnection.cs index 68512e94..e7b3d5e1 100644 --- a/StartGG/Client/Generated/Types/TournamentConnection.cs +++ b/StartGG/Client/Generated/Types/TournamentConnection.cs @@ -5,19 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; -public class TournamentConnection : GraphQLTypeBase, ICursorPaging + +public partial class TournamentConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + [GraphQLMember("nodes")] [JsonPropertyName("nodes")] public List Nodes { get; set; } - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/Client/Generated/Types/User.cs b/StartGG/Client/Generated/Types/User.cs index f5554ad5..906ea6c6 100644 --- a/StartGG/Client/Generated/Types/User.cs +++ b/StartGG/Client/Generated/Types/User.cs @@ -5,69 +5,59 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + public static class UserExtensions { [GraphQLMember("authorizations")] - public static List Authorizations(this User user, - [GraphQLArgument("types", "[SocialConnectionType]")] List types = null) + public static List Authorizations(this User user, [GraphQLArgument("types", "[SocialConnectionType]")] List types = null) { return user.GetMethodValue>("authorizations", types); } [GraphQLMember("events")] - public static EventConnection Events(this User user, - [GraphQLArgument("query", "UserEventsPaginationQuery")] UserEventsPaginationQuery query = null) + public static EventConnection Events(this User user, [GraphQLArgument("query", "UserEventsPaginationQuery")] UserEventsPaginationQuery query = null) { return user.GetMethodValue("events", query); } [GraphQLMember("images")] - public static List Images(this User user, [GraphQLArgument("type", "String")] string type = null) + public static List Images(this User user, [GraphQLArgument("type", "String")] string type = null) { return user.GetMethodValue>("images", type); } [GraphQLMember("leagues")] - public static LeagueConnection Leagues(this User user, - [GraphQLArgument("query", "UserLeaguesPaginationQuery")] UserLeaguesPaginationQuery query = null) + public static LeagueConnection Leagues(this User user, [GraphQLArgument("query", "UserLeaguesPaginationQuery")] UserLeaguesPaginationQuery query = null) { return user.GetMethodValue("leagues", query); } [GraphQLMember("tournaments")] - public static TournamentConnection Tournaments(this User user, - [GraphQLArgument("query", "UserTournamentsPaginationQuery")] UserTournamentsPaginationQuery query = null) + public static TournamentConnection Tournaments(this User user, [GraphQLArgument("query", "UserTournamentsPaginationQuery")] UserTournamentsPaginationQuery query = null) { return user.GetMethodValue("tournaments", query); } + } /// -/// A user +/// A user /// -public class User : GraphQLTypeBase +public partial class User : GraphQLTypeBase { - private readonly LazyProperty> _authorizations = new(); - - private readonly LazyProperty _events = new(); - - private readonly LazyProperty> _images = new(); - - private readonly LazyProperty _leagues = new(); - - private readonly LazyProperty _tournaments = new(); - + private LazyProperty> _authorizations = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// - public List Authorizations => - _authorizations.Value(() => GetFirstMethodValue>("authorizations")); + public List Authorizations => _authorizations.Value(() => GetFirstMethodValue>("authorizations")); [GraphQLMember("id")] [JsonPropertyName("id")] @@ -78,14 +68,14 @@ public class User : GraphQLTypeBase public string Bio { get; set; } /// - /// Public facing user birthday that respects user publishing settings + /// Public facing user birthday that respects user publishing settings /// [GraphQLMember("birthday")] [JsonPropertyName("birthday")] public string Birthday { get; set; } /// - /// Uniquely identifying token for user. Same as the hashed part of the slug + /// Uniquely identifying token for user. Same as the hashed part of the slug /// [GraphQLMember("discriminator")] [JsonPropertyName("discriminator")] @@ -95,8 +85,9 @@ public class User : GraphQLTypeBase [JsonPropertyName("email")] public string Email { get; set; } + private LazyProperty _events = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public EventConnection Events => _events.Value(() => GetFirstMethodValue("events")); @@ -104,32 +95,34 @@ public class User : GraphQLTypeBase [JsonPropertyName("genderPronoun")] public string GenderPronoun { get; set; } + private LazyProperty> _images = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public List Images => _images.Value(() => GetFirstMethodValue>("images")); + private LazyProperty _leagues = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public LeagueConnection Leagues => _leagues.Value(() => GetFirstMethodValue("leagues")); /// - /// Public location info for this user + /// Public location info for this user /// [GraphQLMember("location")] [JsonPropertyName("location")] public Address Location { get; set; } /// - /// Public facing user name that respects user publishing settings + /// Public facing user name that respects user publishing settings /// [GraphQLMember("name")] [JsonPropertyName("name")] public string Name { get; set; } /// - /// player for user + /// player for user /// [GraphQLMember("player")] [JsonPropertyName("player")] @@ -139,9 +132,10 @@ public class User : GraphQLTypeBase [JsonPropertyName("slug")] public string Slug { get; set; } + private LazyProperty _tournaments = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// - public TournamentConnection Tournaments => - _tournaments.Value(() => GetFirstMethodValue("tournaments")); -} \ No newline at end of file + public TournamentConnection Tournaments => _tournaments.Value(() => GetFirstMethodValue("tournaments")); + +} diff --git a/StartGG/Client/Generated/Types/Videogame.cs b/StartGG/Client/Generated/Types/Videogame.cs index ca81133a..c5ae0380 100644 --- a/StartGG/Client/Generated/Types/Videogame.cs +++ b/StartGG/Client/Generated/Types/Videogame.cs @@ -5,34 +5,36 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; + public static class VideogameExtensions { [GraphQLMember("images")] - public static List Images(this Videogame videogame, [GraphQLArgument("type", "String")] string type = null) + public static List Images(this Videogame videogame, [GraphQLArgument("type", "String")] string type = null) { return videogame.GetMethodValue>("images", type); } + } /// -/// A videogame +/// A videogame /// -public class Videogame : GraphQLTypeBase +public partial class Videogame : GraphQLTypeBase { - private readonly LazyProperty> _images = new(); - [GraphQLMember("id")] [JsonPropertyName("id")] public ID Id { get; set; } /// - /// All characters for this videogame + /// All characters for this videogame /// [GraphQLMember("characters")] [JsonPropertyName("characters")] @@ -42,8 +44,9 @@ public class Videogame : GraphQLTypeBase [JsonPropertyName("displayName")] public string DisplayName { get; set; } + private LazyProperty> _images = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// public List Images => _images.Value(() => GetFirstMethodValue>("images")); @@ -56,9 +59,10 @@ public class Videogame : GraphQLTypeBase public string Slug { get; set; } /// - /// All stages for this videogame + /// All stages for this videogame /// [GraphQLMember("stages")] [JsonPropertyName("stages")] public List Stages { get; set; } -} \ No newline at end of file + +} diff --git a/StartGG/Client/Generated/Types/VideogameConnection.cs b/StartGG/Client/Generated/Types/VideogameConnection.cs index ecb079bd..83c81adf 100644 --- a/StartGG/Client/Generated/Types/VideogameConnection.cs +++ b/StartGG/Client/Generated/Types/VideogameConnection.cs @@ -5,19 +5,23 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StartGG.Client; -public class VideogameConnection : GraphQLTypeBase, ICursorPaging + +public partial class VideogameConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + [GraphQLMember("nodes")] [JsonPropertyName("nodes")] public List Nodes { get; set; } - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/StartGG/StartGG.csproj b/StartGG/StartGG.csproj index 183ad3ed..cd2e5931 100644 --- a/StartGG/StartGG.csproj +++ b/StartGG/StartGG.csproj @@ -8,7 +8,7 @@ - + diff --git a/docs/StarWars.Client/Generated/Client/RootMethods.cs b/docs/StarWars.Client/Generated/Client/RootMethods.cs index be6804e2..6ef2f676 100644 --- a/docs/StarWars.Client/Generated/Client/RootMethods.cs +++ b/docs/StarWars.Client/Generated/Client/RootMethods.cs @@ -11,7 +11,7 @@ namespace StarWars.Client; -public class RootMethods +public class RootMethods : IRootMethods { private readonly GraphClient client; @@ -33,7 +33,7 @@ public GraphCursorQuery AllFilms(string after = null, int? firs return new GraphCursorQuery(client, "allFilms", OperationType.Query, arguments); } - public GraphQuery Film(string id = null, string filmID = null) + public GraphQuery Film(ID id = null, ID filmID = null) { var arguments = new List { @@ -57,7 +57,7 @@ public GraphCursorQuery AllPeople(string after = null, int? fi return new GraphCursorQuery(client, "allPeople", OperationType.Query, arguments); } - public GraphQuery Person(string id = null, string personID = null) + public GraphQuery Person(ID id = null, ID personID = null) { var arguments = new List { @@ -81,7 +81,7 @@ public GraphCursorQuery AllPlanets(string after = null, int? return new GraphCursorQuery(client, "allPlanets", OperationType.Query, arguments); } - public GraphQuery Planet(string id = null, string planetID = null) + public GraphQuery Planet(ID id = null, ID planetID = null) { var arguments = new List { @@ -105,7 +105,7 @@ public GraphCursorQuery AllSpecies(string after = null, int? return new GraphCursorQuery(client, "allSpecies", OperationType.Query, arguments); } - public GraphQuery Species(string id = null, string speciesID = null) + public GraphQuery Species(ID id = null, ID speciesID = null) { var arguments = new List { @@ -129,7 +129,7 @@ public GraphCursorQuery AllStarships(string after = null, i return new GraphCursorQuery(client, "allStarships", OperationType.Query, arguments); } - public GraphQuery Starship(string id = null, string starshipID = null) + public GraphQuery Starship(ID id = null, ID starshipID = null) { var arguments = new List { @@ -153,7 +153,7 @@ public GraphCursorQuery AllVehicles(string after = null, int return new GraphCursorQuery(client, "allVehicles", OperationType.Query, arguments); } - public GraphQuery Vehicle(string id = null, string vehicleID = null) + public GraphQuery Vehicle(ID id = null, ID vehicleID = null) { var arguments = new List { @@ -164,7 +164,7 @@ public GraphQuery Vehicle(string id = null, string vehicleID = null) return new GraphQuery(client, "vehicle", OperationType.Query, arguments); } - public GraphQuery Node(string id) + public GraphQuery Node(ID id) { var arguments = new List { diff --git a/docs/StarWars.Client/Generated/Client/StarWarsClient.cs b/docs/StarWars.Client/Generated/Client/StarWarsClient.cs index cc965c15..19dd6b98 100644 --- a/docs/StarWars.Client/Generated/Client/StarWarsClient.cs +++ b/docs/StarWars.Client/Generated/Client/StarWarsClient.cs @@ -11,14 +11,34 @@ namespace StarWars.Client; -public class StarWarsClient -{ - public StarWarsClient(HttpClient httpClient, - [FromKeyedServices("StarWarsClient")] IOptions options, IServiceProvider provider) +/// +/// GraphQL client for StarWarsClient operations +/// +/// +/// Provides strongly-typed access to GraphQL queries, mutations, and subscriptions. +/// Supports dependency injection for better testability and flexibility. +/// +public class StarWarsClient : IStarWarsClient +{ + /// + /// Constructor with dependency injection support + /// + /// HTTP client for GraphQL requests + /// GraphQL client configuration options + /// Service provider for dependency resolution + /// Optional query methods implementation (uses default if null) + public StarWarsClient( + HttpClient httpClient, + [FromKeyedServices("StarWarsClient")] IOptions options, + IServiceProvider provider, + IRootMethods queryMethods = null) { - var client = new GraphClient(httpClient, options, provider); - Query = new(client); + var client = new GraphClient(httpClient, options, provider, false); + Query = queryMethods ?? new RootMethods(client); } - public RootMethods Query { get; private set; } + /// + /// Gets the query methods for this GraphQL client + /// + public IRootMethods Query { get; private set; } } \ No newline at end of file diff --git a/docs/StarWars.Client/Generated/Client/StarWarsClientExtensions.cs b/docs/StarWars.Client/Generated/Client/StarWarsClientExtensions.cs index 7ef4634c..9fdc92b4 100644 --- a/docs/StarWars.Client/Generated/Client/StarWarsClientExtensions.cs +++ b/docs/StarWars.Client/Generated/Client/StarWarsClientExtensions.cs @@ -33,7 +33,7 @@ private static IGraphClientBuilder GraphClientBuilder(IServiceCo GraphClientOptions graphClientOptions) { var opts = Options.Create(graphClientOptions); - services.AddKeyedSingleton(ClientName, opts); + services.AddKeyedSingleton(ClientName, opts); services.AddMemoryCache(); return new ClientBuilder(ClientName, services); } diff --git a/docs/StarWars.Client/Generated/Interfaces/IRootMethods.cs b/docs/StarWars.Client/Generated/Interfaces/IRootMethods.cs new file mode 100644 index 00000000..1bbaacaa --- /dev/null +++ b/docs/StarWars.Client/Generated/Interfaces/IRootMethods.cs @@ -0,0 +1,110 @@ +//--------------------------------------------------------------------- +// 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 Linq2GraphQL.Client; + +namespace StarWars.Client; + +/// +/// Interface for RootMethods GraphQL operations +/// +public interface IRootMethods +{ + /// + /// Executes allFilms GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllFilms(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes film GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Film(ID id = null, ID filmID = null); + + /// + /// Executes allPeople GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllPeople(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes person GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Person(ID id = null, ID personID = null); + + /// + /// Executes allPlanets GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllPlanets(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes planet GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Planet(ID id = null, ID planetID = null); + + /// + /// Executes allSpecies GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllSpecies(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes species GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Species(ID id = null, ID speciesID = null); + + /// + /// Executes allStarships GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllStarships(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes starship GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Starship(ID id = null, ID starshipID = null); + + /// + /// Executes allVehicles GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphCursorQuery + GraphCursorQuery AllVehicles(string after = null, int? first = null, string before = null, int? last = null); + + /// + /// Executes vehicle GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Vehicle(ID id = null, ID vehicleID = null); + + /// + /// Executes node GraphQL operation + /// + /// The operation parameters + /// GraphQL query result of type GraphQuery + GraphQuery Node(ID id); + +} diff --git a/docs/StarWars.Client/Generated/Interfaces/IStarWarsClient.cs b/docs/StarWars.Client/Generated/Interfaces/IStarWarsClient.cs new file mode 100644 index 00000000..aa0ec95e --- /dev/null +++ b/docs/StarWars.Client/Generated/Interfaces/IStarWarsClient.cs @@ -0,0 +1,15 @@ +//--------------------------------------------------------------------- +// 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; + +namespace StarWars.Client; + +public interface IStarWarsClient +{ + IRootMethods Query { get; } +} diff --git a/docs/StarWars.Client/Generated/Interfaces/Node.cs b/docs/StarWars.Client/Generated/Interfaces/Node.cs index e74cf9c7..36e9a310 100644 --- a/docs/StarWars.Client/Generated/Interfaces/Node.cs +++ b/docs/StarWars.Client/Generated/Interfaces/Node.cs @@ -14,11 +14,17 @@ namespace StarWars.Client; -public static class NodeExtentions +/// +/// Extension methods for Node interface type casting +/// +public static class NodeExtensions { - - - [GraphInterface] + /// + /// Casts Node to Film if the runtime type matches + /// + /// The interface value to cast + /// Film instance or null if type doesn't match + [GraphQLMember("Film", true)] public static Film Film(this Node value) { if (value.__TypeName == "Film") @@ -28,7 +34,12 @@ public static Film Film(this Node value) return null; } - [GraphInterface] + /// + /// Casts Node to Person if the runtime type matches + /// + /// The interface value to cast + /// Person instance or null if type doesn't match + [GraphQLMember("Person", true)] public static Person Person(this Node value) { if (value.__TypeName == "Person") @@ -38,7 +49,12 @@ public static Person Person(this Node value) return null; } - [GraphInterface] + /// + /// Casts Node to Planet if the runtime type matches + /// + /// The interface value to cast + /// Planet instance or null if type doesn't match + [GraphQLMember("Planet", true)] public static Planet Planet(this Node value) { if (value.__TypeName == "Planet") @@ -48,7 +64,12 @@ public static Planet Planet(this Node value) return null; } - [GraphInterface] + /// + /// Casts Node to Species if the runtime type matches + /// + /// The interface value to cast + /// Species instance or null if type doesn't match + [GraphQLMember("Species", true)] public static Species Species(this Node value) { if (value.__TypeName == "Species") @@ -58,7 +79,12 @@ public static Species Species(this Node value) return null; } - [GraphInterface] + /// + /// Casts Node to Starship if the runtime type matches + /// + /// The interface value to cast + /// Starship instance or null if type doesn't match + [GraphQLMember("Starship", true)] public static Starship Starship(this Node value) { if (value.__TypeName == "Starship") @@ -68,7 +94,12 @@ public static Starship Starship(this Node value) return null; } - [GraphInterface] + /// + /// Casts Node to Vehicle if the runtime type matches + /// + /// The interface value to cast + /// Vehicle instance or null if type doesn't match + [GraphQLMember("Vehicle", true)] public static Vehicle Vehicle(this Node value) { if (value.__TypeName == "Vehicle") @@ -77,42 +108,65 @@ public static Vehicle Vehicle(this Node value) } return null; } -} +} +/// +/// JSON converter for Node interface deserialization +/// internal class NodeConverter : InterfaceJsonConverter { + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type public override Node Deserialize(string typeName, JsonObject json) => typeName switch { - "Film" => json.Deserialize(), - "Person" => json.Deserialize(), - "Planet" => json.Deserialize(), - "Species" => json.Deserialize(), - "Starship" => json.Deserialize(), - "Vehicle" => json.Deserialize(), - _ => json.Deserialize< Node__Concrete>() + "Film" => json.Deserialize(), + "Person" => json.Deserialize(), + "Planet" => json.Deserialize(), + "Species" => json.Deserialize(), + "Starship" => json.Deserialize(), + "Vehicle" => json.Deserialize(), + _ => json.Deserialize() }; } - - - +/// +/// GraphQL interface Node with all common fields +/// [JsonConverter(typeof(NodeConverter))] public interface Node { - [GraphQLMember("id")] - public string Id { get; set; } + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + ID Id { get; set; } + + /// + /// GraphQL __typename field for runtime type resolution + /// [GraphQLMember("__typename")] - public string __TypeName { get; set; } - + string __TypeName { get; set; } } +/// +/// Concrete implementation of Node interface for fallback deserialization +/// internal class Node__Concrete : Node { - [GraphQLMember("id")] - public string Id { get; set; } - + /// + /// id field from GraphQL schema + /// + [GraphQLMember("id")] + public ID Id { get; set; } + + /// + /// GraphQL __typename field for runtime type resolution + /// [GraphQLMember("__typename")] public string __TypeName { get; set; } - } \ No newline at end of file diff --git a/docs/StarWars.Client/Generated/Scalars/ID.cs b/docs/StarWars.Client/Generated/Scalars/ID.cs new file mode 100644 index 00000000..508fa939 --- /dev/null +++ b/docs/StarWars.Client/Generated/Scalars/ID.cs @@ -0,0 +1,18 @@ +//--------------------------------------------------------------------- +// 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 System.Text.Json.Serialization; + +namespace StarWars.Client; + + /// + /// The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. + /// + [JsonConverter(typeof(CustomScalarConverter))] + public partial class ID : CustomScalar {} \ No newline at end of file diff --git a/docs/StarWars.Client/Generated/Types/Film.cs b/docs/StarWars.Client/Generated/Types/Film.cs index 45e0c3a0..e48f1a9c 100644 --- a/docs/StarWars.Client/Generated/Types/Film.cs +++ b/docs/StarWars.Client/Generated/Types/Film.cs @@ -144,7 +144,7 @@ public partial class Film : GraphQLTypeBase, Node /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] diff --git a/docs/StarWars.Client/Generated/Types/FilmPlanetsConnection.cs b/docs/StarWars.Client/Generated/Types/FilmPlanetsConnection.cs index cffe8796..eb2ac52d 100644 --- a/docs/StarWars.Client/Generated/Types/FilmPlanetsConnection.cs +++ b/docs/StarWars.Client/Generated/Types/FilmPlanetsConnection.cs @@ -5,50 +5,54 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// A connection to a list of items. +/// A connection to a list of items. /// -public class FilmPlanetsConnection : GraphQLTypeBase, ICursorPaging +public partial class FilmPlanetsConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { /// - /// A list of edges. + /// Information to aid in pagination. + /// + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + + /// + /// A list of edges. /// [GraphQLMember("edges")] [JsonPropertyName("edges")] public List Edges { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("totalCount")] [JsonPropertyName("totalCount")] public int? TotalCount { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("planets")] [JsonPropertyName("planets")] public List Planets { get; set; } - /// - /// Information to aid in pagination. - /// - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/docs/StarWars.Client/Generated/Types/FilmStarshipsConnection.cs b/docs/StarWars.Client/Generated/Types/FilmStarshipsConnection.cs index b64332f1..0f8f72e8 100644 --- a/docs/StarWars.Client/Generated/Types/FilmStarshipsConnection.cs +++ b/docs/StarWars.Client/Generated/Types/FilmStarshipsConnection.cs @@ -5,50 +5,54 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// A connection to a list of items. +/// A connection to a list of items. /// -public class FilmStarshipsConnection : GraphQLTypeBase, ICursorPaging +public partial class FilmStarshipsConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { /// - /// A list of edges. + /// Information to aid in pagination. + /// + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + + /// + /// A list of edges. /// [GraphQLMember("edges")] [JsonPropertyName("edges")] public List Edges { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("totalCount")] [JsonPropertyName("totalCount")] public int? TotalCount { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("starships")] [JsonPropertyName("starships")] public List Starships { get; set; } - /// - /// Information to aid in pagination. - /// - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/docs/StarWars.Client/Generated/Types/FilmStarshipsEdge.cs b/docs/StarWars.Client/Generated/Types/FilmStarshipsEdge.cs index d1d1a499..ce93a212 100644 --- a/docs/StarWars.Client/Generated/Types/FilmStarshipsEdge.cs +++ b/docs/StarWars.Client/Generated/Types/FilmStarshipsEdge.cs @@ -5,28 +5,32 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// An edge in a connection. +/// An edge in a connection. /// -public class FilmStarshipsEdge : GraphQLTypeBase +public partial class FilmStarshipsEdge : GraphQLTypeBase { /// - /// The item at the end of the edge + /// The item at the end of the edge /// [GraphQLMember("node")] [JsonPropertyName("node")] public Starship Node { get; set; } /// - /// A cursor for use in pagination + /// A cursor for use in pagination /// [GraphQLMember("cursor")] [JsonPropertyName("cursor")] public string Cursor { get; set; } -} \ No newline at end of file + +} diff --git a/docs/StarWars.Client/Generated/Types/FilmVehiclesConnection.cs b/docs/StarWars.Client/Generated/Types/FilmVehiclesConnection.cs index 89fa8fad..4a4bce8d 100644 --- a/docs/StarWars.Client/Generated/Types/FilmVehiclesConnection.cs +++ b/docs/StarWars.Client/Generated/Types/FilmVehiclesConnection.cs @@ -5,50 +5,54 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// A connection to a list of items. +/// A connection to a list of items. /// -public class FilmVehiclesConnection : GraphQLTypeBase, ICursorPaging +public partial class FilmVehiclesConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { /// - /// A list of edges. + /// Information to aid in pagination. + /// + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + + /// + /// A list of edges. /// [GraphQLMember("edges")] [JsonPropertyName("edges")] public List Edges { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("totalCount")] [JsonPropertyName("totalCount")] public int? TotalCount { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("vehicles")] [JsonPropertyName("vehicles")] public List Vehicles { get; set; } - /// - /// Information to aid in pagination. - /// - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/docs/StarWars.Client/Generated/Types/Person.cs b/docs/StarWars.Client/Generated/Types/Person.cs index ee7ded69..fa9fd56b 100644 --- a/docs/StarWars.Client/Generated/Types/Person.cs +++ b/docs/StarWars.Client/Generated/Types/Person.cs @@ -153,7 +153,7 @@ public partial class Person : GraphQLTypeBase, Node /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] diff --git a/docs/StarWars.Client/Generated/Types/Planet.cs b/docs/StarWars.Client/Generated/Types/Planet.cs index ed5c2784..c991832c 100644 --- a/docs/StarWars.Client/Generated/Types/Planet.cs +++ b/docs/StarWars.Client/Generated/Types/Planet.cs @@ -134,7 +134,7 @@ public partial class Planet : GraphQLTypeBase, Node /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] diff --git a/docs/StarWars.Client/Generated/Types/PlanetResidentsConnection.cs b/docs/StarWars.Client/Generated/Types/PlanetResidentsConnection.cs index b094d2db..99762c7d 100644 --- a/docs/StarWars.Client/Generated/Types/PlanetResidentsConnection.cs +++ b/docs/StarWars.Client/Generated/Types/PlanetResidentsConnection.cs @@ -5,50 +5,54 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// A connection to a list of items. +/// A connection to a list of items. /// -public class PlanetResidentsConnection : GraphQLTypeBase, ICursorPaging +public partial class PlanetResidentsConnection : GraphQLTypeBase, Linq2GraphQL.Client.Common.ICursorPaging { /// - /// A list of edges. + /// Information to aid in pagination. + /// + [GraphQLMember("pageInfo")] + [JsonPropertyName("pageInfo")] + public Linq2GraphQL.Client.Common.PageInfo PageInfo { get; set; } + + /// + /// A list of edges. /// [GraphQLMember("edges")] [JsonPropertyName("edges")] public List Edges { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("totalCount")] [JsonPropertyName("totalCount")] public int? TotalCount { get; set; } /// - /// 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. + /// 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. /// [GraphQLMember("residents")] [JsonPropertyName("residents")] public List Residents { get; set; } - /// - /// Information to aid in pagination. - /// - [GraphQLMember("pageInfo")] - [JsonPropertyName("pageInfo")] - public PageInfo PageInfo { get; set; } -} \ No newline at end of file +} diff --git a/docs/StarWars.Client/Generated/Types/PlanetResidentsEdge.cs b/docs/StarWars.Client/Generated/Types/PlanetResidentsEdge.cs index da1782b3..c27fb16a 100644 --- a/docs/StarWars.Client/Generated/Types/PlanetResidentsEdge.cs +++ b/docs/StarWars.Client/Generated/Types/PlanetResidentsEdge.cs @@ -5,28 +5,32 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// An edge in a connection. +/// An edge in a connection. /// -public class PlanetResidentsEdge : GraphQLTypeBase +public partial class PlanetResidentsEdge : GraphQLTypeBase { /// - /// The item at the end of the edge + /// The item at the end of the edge /// [GraphQLMember("node")] [JsonPropertyName("node")] public Person Node { get; set; } /// - /// A cursor for use in pagination + /// A cursor for use in pagination /// [GraphQLMember("cursor")] [JsonPropertyName("cursor")] public string Cursor { get; set; } -} \ No newline at end of file + +} diff --git a/docs/StarWars.Client/Generated/Types/Species.cs b/docs/StarWars.Client/Generated/Types/Species.cs index d1e7c0c3..954ad544 100644 --- a/docs/StarWars.Client/Generated/Types/Species.cs +++ b/docs/StarWars.Client/Generated/Types/Species.cs @@ -139,7 +139,7 @@ public partial class Species : GraphQLTypeBase, Node /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] diff --git a/docs/StarWars.Client/Generated/Types/Starship.cs b/docs/StarWars.Client/Generated/Types/Starship.cs index 0e2f452c..7d4a405a 100644 --- a/docs/StarWars.Client/Generated/Types/Starship.cs +++ b/docs/StarWars.Client/Generated/Types/Starship.cs @@ -5,173 +5,169 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + public static class StarshipExtensions { [GraphQLMember("pilotConnection")] - public static StarshipPilotsConnection PilotConnection(this Starship starship, - [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, - [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null) + public static StarshipPilotsConnection PilotConnection(this Starship starship, [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 starship.GetMethodValue("pilotConnection", after, first, before, last); } [GraphQLMember("filmConnection")] - public static StarshipFilmsConnection FilmConnection(this Starship starship, - [GraphQLArgument("after", "String")] string after = null, [GraphQLArgument("first", "Int")] int? first = null, - [GraphQLArgument("before", "String")] string before = null, [GraphQLArgument("last", "Int")] int? last = null) + public static StarshipFilmsConnection FilmConnection(this Starship starship, [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 starship.GetMethodValue("filmConnection", after, first, before, last); } + } /// -/// A single transport craft that has hyperdrive capability. +/// A single transport craft that has hyperdrive capability. /// -public class Starship : GraphQLTypeBase, Node +public partial class Starship : GraphQLTypeBase, Node { - private readonly LazyProperty _filmConnection = new(); - - private readonly LazyProperty _pilotConnection = new(); - /// - /// The name of this starship. The common name, such as "Death Star". + /// The name of this starship. The common name, such as "Death Star". /// [GraphQLMember("name")] [JsonPropertyName("name")] public string Name { get; set; } /// - /// The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 - /// Orbital Battle Station". + /// The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 +/// Orbital Battle Station". /// [GraphQLMember("model")] [JsonPropertyName("model")] public string Model { get; set; } /// - /// The class of this starship, such as "Starfighter" or "Deep Space Mobile - /// Battlestation" + /// The class of this starship, such as "Starfighter" or "Deep Space Mobile +/// Battlestation" /// [GraphQLMember("starshipClass")] [JsonPropertyName("starshipClass")] public string StarshipClass { get; set; } /// - /// The manufacturers of this starship. + /// The manufacturers of this starship. /// [GraphQLMember("manufacturers")] [JsonPropertyName("manufacturers")] public List Manufacturers { get; set; } /// - /// The cost of this starship new, in galactic credits. + /// The cost of this starship new, in galactic credits. /// [GraphQLMember("costInCredits")] [JsonPropertyName("costInCredits")] public double? CostInCredits { get; set; } /// - /// The length of this starship in meters. + /// The length of this starship in meters. /// [GraphQLMember("length")] [JsonPropertyName("length")] public double? Length { get; set; } /// - /// The number of personnel needed to run or pilot this starship. + /// The number of personnel needed to run or pilot this starship. /// [GraphQLMember("crew")] [JsonPropertyName("crew")] public string Crew { get; set; } /// - /// The number of non-essential people this starship can transport. + /// The number of non-essential people this starship can transport. /// [GraphQLMember("passengers")] [JsonPropertyName("passengers")] public string Passengers { get; set; } /// - /// The maximum speed of this starship in atmosphere. null if this starship is - /// incapable of atmosphering flight. + /// The maximum speed of this starship in atmosphere. null if this starship is +/// incapable of atmosphering flight. /// [GraphQLMember("maxAtmospheringSpeed")] [JsonPropertyName("maxAtmospheringSpeed")] public int? MaxAtmospheringSpeed { get; set; } /// - /// The class of this starships hyperdrive. + /// The class of this starships hyperdrive. /// [GraphQLMember("hyperdriveRating")] [JsonPropertyName("hyperdriveRating")] public double? HyperdriveRating { get; set; } /// - /// The Maximum number of Megalights this starship can travel in a standard hour. - /// A "Megalight" is a standard unit of distance and has never been defined before - /// within the Star Wars universe. This figure is only really useful for measuring - /// the difference in speed of starships. We can assume it is similar to AU, the - /// distance between our Sun (Sol) and Earth. + /// The Maximum number of Megalights this starship can travel in a standard hour. +/// A "Megalight" is a standard unit of distance and has never been defined before +/// within the Star Wars universe. This figure is only really useful for measuring +/// the difference in speed of starships. We can assume it is similar to AU, the +/// distance between our Sun (Sol) and Earth. /// [GraphQLMember("MGLT")] [JsonPropertyName("MGLT")] public int? MGLT { get; set; } /// - /// The maximum number of kilograms that this starship can transport. + /// The maximum number of kilograms that this starship can transport. /// [GraphQLMember("cargoCapacity")] [JsonPropertyName("cargoCapacity")] public double? CargoCapacity { get; set; } /// - /// The maximum length of time that this starship can provide consumables for its - /// entire crew without having to resupply. + /// The maximum length of time that this starship can provide consumables for its +/// entire crew without having to resupply. /// [GraphQLMember("consumables")] [JsonPropertyName("consumables")] public string Consumables { get; set; } + private LazyProperty _pilotConnection = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// - public StarshipPilotsConnection PilotConnection => - _pilotConnection.Value(() => GetFirstMethodValue("pilotConnection")); + public StarshipPilotsConnection PilotConnection => _pilotConnection.Value(() => GetFirstMethodValue("pilotConnection")); + private LazyProperty _filmConnection = new(); /// - /// Do not use in Query, only to retrive result + /// Do not use in Query, only to retrive result /// - public StarshipFilmsConnection FilmConnection => - _filmConnection.Value(() => GetFirstMethodValue("filmConnection")); + public StarshipFilmsConnection FilmConnection => _filmConnection.Value(() => GetFirstMethodValue("filmConnection")); /// - /// The ISO 8601 date format of the time that this resource was created. + /// The ISO 8601 date format of the time that this resource was created. /// [GraphQLMember("created")] [JsonPropertyName("created")] public string Created { get; set; } /// - /// The ISO 8601 date format of the time that this resource was edited. + /// The ISO 8601 date format of the time that this resource was edited. /// [GraphQLMember("edited")] [JsonPropertyName("edited")] public string Edited { get; set; } /// - /// The ID of an object + /// The ID of an object /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] public string __TypeName { get; set; } -} \ No newline at end of file +} diff --git a/docs/StarWars.Client/Generated/Types/Vehicle.cs b/docs/StarWars.Client/Generated/Types/Vehicle.cs index e7134432..62f06e7a 100644 --- a/docs/StarWars.Client/Generated/Types/Vehicle.cs +++ b/docs/StarWars.Client/Generated/Types/Vehicle.cs @@ -146,7 +146,7 @@ public partial class Vehicle : GraphQLTypeBase, Node /// [GraphQLMember("id")] [JsonPropertyName("id")] - public string Id { get; set; } + public ID Id { get; set; } [GraphQLMember("__typename")] [JsonPropertyName("__typename")] diff --git a/docs/StarWars.Client/Generated/Types/VehicleFilmsEdge.cs b/docs/StarWars.Client/Generated/Types/VehicleFilmsEdge.cs index 907b1f19..e9527bf0 100644 --- a/docs/StarWars.Client/Generated/Types/VehicleFilmsEdge.cs +++ b/docs/StarWars.Client/Generated/Types/VehicleFilmsEdge.cs @@ -5,28 +5,32 @@ // Url: https://linq2graphql.com //--------------------------------------------------------------------- +using System; +using System.Collections.Generic; using System.Text.Json.Serialization; using Linq2GraphQL.Client; using Linq2GraphQL.Client.Common; namespace StarWars.Client; + /// -/// An edge in a connection. +/// An edge in a connection. /// -public class VehicleFilmsEdge : GraphQLTypeBase +public partial class VehicleFilmsEdge : GraphQLTypeBase { /// - /// The item at the end of the edge + /// The item at the end of the edge /// [GraphQLMember("node")] [JsonPropertyName("node")] public Film Node { get; set; } /// - /// A cursor for use in pagination + /// A cursor for use in pagination /// [GraphQLMember("cursor")] [JsonPropertyName("cursor")] public string Cursor { get; set; } -} \ No newline at end of file + +} diff --git a/docs/StarWars.Client/StarWars.Client.csproj b/docs/StarWars.Client/StarWars.Client.csproj index 1a444581..37b344c2 100644 --- a/docs/StarWars.Client/StarWars.Client.csproj +++ b/docs/StarWars.Client/StarWars.Client.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/Linq2GraphQL.Client/Attributes/GraphInterfaceAttribute.cs b/src/Linq2GraphQL.Client/Attributes/GraphInterfaceAttribute.cs index 75338883..944f81a7 100644 --- a/src/Linq2GraphQL.Client/Attributes/GraphInterfaceAttribute.cs +++ b/src/Linq2GraphQL.Client/Attributes/GraphInterfaceAttribute.cs @@ -1,5 +1,10 @@ namespace Linq2GraphQL.Client; + +/// +/// Will be removed in future versions +/// Only here for backward compatibility +/// [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] public class GraphInterfaceAttribute : Attribute { diff --git a/src/Linq2GraphQL.Client/Attributes/GraphQLMemberAttribute.cs b/src/Linq2GraphQL.Client/Attributes/GraphQLMemberAttribute.cs index 36bb92a0..ff6a0f3c 100644 --- a/src/Linq2GraphQL.Client/Attributes/GraphQLMemberAttribute.cs +++ b/src/Linq2GraphQL.Client/Attributes/GraphQLMemberAttribute.cs @@ -3,10 +3,13 @@ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method)] public class GraphQLMemberAttribute : Attribute { - public GraphQLMemberAttribute(string graphQLName) + public GraphQLMemberAttribute(string graphQLName, bool interfaceProperty = false) { GraphQLName = graphQLName; + InterfaceProperty = interfaceProperty; } public string GraphQLName { get; private set; } + + public bool InterfaceProperty { get; set; } } \ No newline at end of file diff --git a/src/Linq2GraphQL.Client/GraphBase.cs b/src/Linq2GraphQL.Client/GraphBase.cs index b81c8b8a..bf90a2a3 100644 --- a/src/Linq2GraphQL.Client/GraphBase.cs +++ b/src/Linq2GraphQL.Client/GraphBase.cs @@ -11,7 +11,7 @@ public GraphBase(GraphClient client, string name, OperationType operationType, L { this.client = client; this.operationType = operationType; - QueryNode = new(typeof(T), name, arguments, false, true); + QueryNode = new(typeof(T), name, arguments, null, true); } public QueryNode QueryNode { get; } diff --git a/src/Linq2GraphQL.Client/QueryNode.cs b/src/Linq2GraphQL.Client/QueryNode.cs index adfcdaef..e743bedf 100644 --- a/src/Linq2GraphQL.Client/QueryNode.cs +++ b/src/Linq2GraphQL.Client/QueryNode.cs @@ -10,14 +10,16 @@ public class QueryNode private string argumentHashCodeId; public QueryNode(MemberInfo member, string name = null, List arguments = null, - bool interfaceProperty = false, bool topLevel = false) + bool? interfaceProperty = null, bool topLevel = false) { - Name = name ?? member.GetCustomAttribute()?.GraphQLName ?? member.Name.ToCamelCase(); + var memberAttribute = member.GetCustomAttribute(); + + Name = name ?? memberAttribute?.GraphQLName ?? member.Name.ToCamelCase(); Member = member; Arguments = arguments ?? new List(); underlyingMemberType = member.GetUnderlyingType(); mustHaveChildren = MustHaveChildren(underlyingMemberType); - InterfaceProperty = interfaceProperty; + InterfaceProperty = memberAttribute?.InterfaceProperty == true; if (!topLevel) { diff --git a/src/Linq2GraphQL.Generator/Properties/launchSettings.json b/src/Linq2GraphQL.Generator/Properties/launchSettings.json index 9b50de83..f1dfb782 100644 --- a/src/Linq2GraphQL.Generator/Properties/launchSettings.json +++ b/src/Linq2GraphQL.Generator/Properties/launchSettings.json @@ -2,8 +2,7 @@ "profiles": { "Linq2GraphQL.Generator": { "commandName": "Project", -// "commandLineArgs": "https://localhost:7184/graphql/ -c=\"SampleClient\" -n=\"Linq2GraphQL.TestClient\" -o=\"C:\\Code\\Linq2GraphQL.Client\\test\\Linq2GraphQL.TestClient\\Generated\" -s=true -d=true" - "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" + "commandLineArgs": "https://localhost:7184/graphql/ -c=\"SampleClient\" -n=\"Linq2GraphQL.TestClient\" -o=\"C:\\Code\\Github\\Linq2GraphQL.Client\\test\\Linq2GraphQL.TestClient\\Generated\" -s=true -d=true" } } } \ No newline at end of file diff --git a/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.cs b/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.cs index caf135b1..a48126bc 100644 --- a/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.cs +++ b/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.cs @@ -1,7 +1,7 @@ // ------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version: 16.0.0.0 +// Runtime Version: 18.0.0.0 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -15,8 +15,8 @@ namespace Linq2GraphQL.Generator.Templates.Interface /// Class to produce the template output /// - #line 1 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + #line 1 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")] public partial class InterfaceTemplate : InterfaceTemplateBase { #line hidden @@ -25,30 +25,32 @@ public partial class InterfaceTemplate : InterfaceTemplateBase /// public virtual string TransformText() { - this.Write("using System;\r\nusing System.Text.Json;\r\nusing System.Text.Json.Nodes;\r\nusing System.Text.Json.Serialization;\r\nusing Linq2GraphQL.Client;\r\nusing Linq2GraphQL.Client.Converters;\r\n\r\nnamespace "); + this.Write("using System;\r\nusing System.Text.Json;\r\nusing System.Text.Json.Nodes;\r\nusing Syst" + + "em.Text.Json.Serialization;\r\nusing Linq2GraphQL.Client;\r\nusing Linq2GraphQL.Clie" + + "nt.Converters;\r\n\r\nnamespace "); - #line 10 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 10 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(namespaceName)); #line default #line hidden this.Write(";\r\n\r\n/// \r\n/// Extension methods for "); - #line 13 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 13 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" interface type casting\r\n/// \r\npublic static class "); - #line 15 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 15 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write("Extensions\r\n{\r\n"); - #line 17 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 17 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" foreach (var field in implementedBy) { @@ -58,63 +60,71 @@ public virtual string TransformText() #line hidden this.Write(" /// \r\n /// Casts "); - #line 22 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 22 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" to "); - #line 22 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 22 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden - this.Write(" if the runtime type matches\r\n /// \r\n /// The interface value to cast\r\n /// "); + this.Write(" if the runtime type matches\r\n /// \r\n /// The" + + " interface value to cast\r\n /// "); - #line 25 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 25 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden - this.Write(" instance or null if type doesn't match\r\n [GraphInterface]\r\n public static "); + this.Write(" instance or null if type doesn\'t match\r\n [GraphQLMember(\""); - #line 27 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 26 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + this.Write(this.ToStringHelper.ToStringWithCulture(field)); + + #line default + #line hidden + this.Write("\", true)]\r\n public static "); + + #line 27 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write(" "); - #line 27 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 27 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write("(this "); - #line 27 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 27 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" value)\r\n {\r\n if (value.__TypeName == \""); - #line 29 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 29 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write("\")\r\n {\r\n return ("); - #line 31 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 31 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write(")value;\r\n }\r\n return null;\r\n }\r\n\r\n"); - #line 36 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 36 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" } @@ -123,35 +133,43 @@ public virtual string TransformText() #line hidden this.Write("}\r\n\r\n/// \r\n/// JSON converter for "); - #line 42 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 42 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" interface deserialization\r\n/// \r\ninternal class "); - #line 44 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 44 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(GetInterfaceConverterName())); #line default #line hidden this.Write(" : InterfaceJsonConverter<"); - #line 44 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 44 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden - this.Write(">\r\n{\r\n /// \r\n /// Deserializes JSON to the appropriate concrete type based on __typename\r\n /// \r\n /// The GraphQL type name from __typename field\r\n /// The JSON object to deserialize\r\n /// Deserialized instance of the appropriate concrete type\r\n public override "); + this.Write(@"> +{ + /// + /// Deserializes JSON to the appropriate concrete type based on __typename + /// + /// The GraphQL type name from __typename field + /// The JSON object to deserialize + /// Deserialized instance of the appropriate concrete type + public override "); - #line 52 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 52 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" Deserialize(string typeName, JsonObject json) => typeName switch\r\n {\r\n"); - #line 54 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 54 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" foreach (var field in implementedBy) { @@ -161,21 +179,21 @@ public virtual string TransformText() #line hidden this.Write(" \""); - #line 58 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 58 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write("\" => json.Deserialize<"); - #line 58 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 58 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field)); #line default #line hidden this.Write(">(),\r\n"); - #line 59 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 59 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" } @@ -184,42 +202,42 @@ public virtual string TransformText() #line hidden this.Write(" _ => json.Deserialize<"); - #line 62 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 62 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(GetInterfaceConcreteName())); #line default #line hidden this.Write(">()\r\n };\r\n}\r\n\r\n/// \r\n/// GraphQL interface "); - #line 67 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 67 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" with all common fields\r\n/// \r\n[JsonConverter(typeof("); - #line 69 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 69 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(GetInterfaceConverterName())); #line default #line hidden this.Write("))]\r\npublic interface "); - #line 70 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 70 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" "); - #line 70 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 70 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.GetInterfacesString())); #line default #line hidden this.Write("\r\n{\r\n"); - #line 72 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 72 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" foreach (var field in classType.AllFields) { @@ -230,65 +248,67 @@ public virtual string TransformText() #line hidden this.Write(" /// \r\n /// "); - #line 78 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 78 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.Name)); #line default #line hidden this.Write(" field from GraphQL schema\r\n /// \r\n [GraphQLMember(\""); - #line 80 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 80 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.Name)); #line default #line hidden this.Write("\")]\r\n "); - #line 81 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 81 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(coreType.CSharpTypeDefinition)); #line default #line hidden this.Write(" "); - #line 81 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 81 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.CSharpName)); #line default #line hidden this.Write(" { get; set; }\r\n\r\n"); - #line 83 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 83 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" } #line default #line hidden - this.Write(" /// \r\n /// GraphQL __typename field for runtime type resolution\r\n /// \r\n [GraphQLMember(\"__typename\")]\r\n string __TypeName { get; set; }\r\n}\r\n\r\n/// \r\n/// Concrete implementation of "); + this.Write(" /// \r\n /// GraphQL __typename field for runtime type resolution\r\n" + + " /// \r\n [GraphQLMember(\"__typename\")]\r\n string __TypeName { g" + + "et; set; }\r\n}\r\n\r\n/// \r\n/// Concrete implementation of "); - #line 94 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 94 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write(" interface for fallback deserialization\r\n/// \r\ninternal class "); - #line 96 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 96 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(GetInterfaceConcreteName())); #line default #line hidden this.Write(" : "); - #line 96 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 96 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(classType.Name)); #line default #line hidden this.Write("\r\n{\r\n"); - #line 98 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 98 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" foreach (var field in classType.AllFields) { @@ -299,42 +319,44 @@ public virtual string TransformText() #line hidden this.Write(" /// \r\n /// "); - #line 104 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 104 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.Name)); #line default #line hidden this.Write(" field from GraphQL schema\r\n /// \r\n [GraphQLMember(\""); - #line 106 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 106 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.Name)); #line default #line hidden this.Write("\")]\r\n public "); - #line 107 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 107 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(coreType.CSharpTypeDefinition)); #line default #line hidden this.Write(" "); - #line 107 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 107 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" this.Write(this.ToStringHelper.ToStringWithCulture(field.CSharpName)); #line default #line hidden this.Write(" { get; set; }\r\n\r\n"); - #line 109 "C:\Code\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" + #line 109 "C:\Code\Github\Linq2GraphQL.Client\src\Linq2GraphQL.Generator\Templates\Interface\InterfaceTemplate.tt" } #line default #line hidden - this.Write(" /// \r\n /// GraphQL __typename field for runtime type resolution\r\n /// \r\n [GraphQLMember(\"__typename\")]\r\n public string __TypeName { get; set; }\r\n}"); + this.Write(" /// \r\n /// GraphQL __typename field for runtime type resolution\r\n" + + " /// \r\n [GraphQLMember(\"__typename\")]\r\n public string __TypeN" + + "ame { get; set; }\r\n}"); return this.GenerationEnvironment.ToString(); } } @@ -345,7 +367,7 @@ public virtual string TransformText() /// /// Base class for this transformation /// - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "18.0.0.0")] public class InterfaceTemplateBase { #region Fields @@ -360,7 +382,7 @@ public class InterfaceTemplateBase /// /// The string builder that generation-time code is using to assemble generated output /// - protected System.Text.StringBuilder GenerationEnvironment + public System.Text.StringBuilder GenerationEnvironment { get { diff --git a/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.tt b/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.tt index fc23a18d..d8905e31 100644 --- a/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.tt +++ b/src/Linq2GraphQL.Generator/Templates/Interface/InterfaceTemplate.tt @@ -23,7 +23,7 @@ public static class <#= classType.Name #>Extensions /// /// The interface value to cast /// <#= field #> instance or null if type doesn't match - [GraphInterface] + [GraphQLMember("<#= field #>", true)] public static <#= field #> <#= field #>(this <#= classType.Name #> value) { if (value.__TypeName == "<#= field #>") diff --git a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerFilterInput.cs b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerFilterInput.cs index 59d88914..23f9d8ec 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerFilterInput.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerFilterInput.cs @@ -71,4 +71,12 @@ public AddressFilterInput Address set => SetValue("address", value); } + [GraphQLMember("created")] + [JsonPropertyName("created")] + public DateTimeOperationFilterInput Created + { + get => GetValue("created"); + set => SetValue("created", value); + } + } \ No newline at end of file diff --git a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerInput.cs b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerInput.cs index 1e463f2f..b619e7ea 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerInput.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerInput.cs @@ -55,4 +55,12 @@ public AddressInput Address set => SetValue("address", value); } + [GraphQLMember("created")] + [JsonPropertyName("created")] + public DateTimeOffset? Created + { + get => GetValue("created"); + set => SetValue("created", value); + } + } \ No newline at end of file diff --git a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerSortInput.cs b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerSortInput.cs index 8e9f2879..4d25c4a2 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerSortInput.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Inputs/CustomerSortInput.cs @@ -47,4 +47,12 @@ public AddressSortInput Address set => SetValue("address", value); } + [GraphQLMember("created")] + [JsonPropertyName("created")] + public SortEnumType? Created + { + get => GetValue("created"); + set => SetValue("created", value); + } + } \ No newline at end of file diff --git a/test/Linq2GraphQL.TestClient/Generated/Inputs/InputFactory.cs b/test/Linq2GraphQL.TestClient/Generated/Inputs/InputFactory.cs index b5db63fa..82a07137 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Inputs/InputFactory.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Inputs/InputFactory.cs @@ -405,6 +405,15 @@ public static CustomerFilterInput Address(this CustomerFilterInput input, Action return input; } + public static CustomerFilterInput Created(this CustomerFilterInput input, Action mod) + { + var filter = new DateTimeOperationFilterInput(); + mod ??= _ => { }; + mod(filter); + input.Created = filter; + return input; + } + } public static class CustomerInputExtensions @@ -448,6 +457,13 @@ public static CustomerInput Address(this CustomerInput input, Action))] -public class TimeSpanOperationFilterInput : GraphInputBase -{ - [GraphQLMember("eq")] - [JsonPropertyName("eq")] - public TimeSpan? Eq - { - get => GetValue("eq"); - set => SetValue("eq", value); - } - - [GraphQLMember("neq")] - [JsonPropertyName("neq")] - public TimeSpan? Neq - { - get => GetValue("neq"); - set => SetValue("neq", value); - } - - [GraphQLMember("in")] - [JsonPropertyName("in")] - public List In - { - get => GetValue>("in"); - set => SetValue("in", value); - } - - [GraphQLMember("nin")] - [JsonPropertyName("nin")] - public List Nin - { - get => GetValue>("nin"); - set => SetValue("nin", value); - } - - [GraphQLMember("gt")] - [JsonPropertyName("gt")] - public TimeSpan? Gt - { - get => GetValue("gt"); - set => SetValue("gt", value); - } - - [GraphQLMember("ngt")] - [JsonPropertyName("ngt")] - public TimeSpan? Ngt - { - get => GetValue("ngt"); - set => SetValue("ngt", value); - } - - [GraphQLMember("gte")] - [JsonPropertyName("gte")] - public TimeSpan? Gte - { - get => GetValue("gte"); - set => SetValue("gte", value); - } - - [GraphQLMember("ngte")] - [JsonPropertyName("ngte")] - public TimeSpan? Ngte - { - get => GetValue("ngte"); - set => SetValue("ngte", value); - } - - [GraphQLMember("lt")] - [JsonPropertyName("lt")] - public TimeSpan? Lt - { - get => GetValue("lt"); - set => SetValue("lt", value); - } - - [GraphQLMember("nlt")] - [JsonPropertyName("nlt")] - public TimeSpan? Nlt - { - get => GetValue("nlt"); - set => SetValue("nlt", value); - } - - [GraphQLMember("lte")] - [JsonPropertyName("lte")] - public TimeSpan? Lte - { - get => GetValue("lte"); - set => SetValue("lte", value); - } - - [GraphQLMember("nlte")] - [JsonPropertyName("nlte")] - public TimeSpan? Nlte - { - get => GetValue("nlte"); - set => SetValue("nlte", value); - } -} \ No newline at end of file diff --git a/test/Linq2GraphQL.TestClient/Generated/Interfaces/IAnimal.cs b/test/Linq2GraphQL.TestClient/Generated/Interfaces/IAnimal.cs index aa90977c..4b30ae70 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Interfaces/IAnimal.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Interfaces/IAnimal.cs @@ -24,7 +24,7 @@ public static class IAnimalExtensions /// /// The interface value to cast /// Pig instance or null if type doesn't match - [GraphInterface] + [GraphQLMember("Pig", true)] public static Pig Pig(this IAnimal value) { if (value.__TypeName == "Pig") @@ -39,7 +39,7 @@ public static Pig Pig(this IAnimal value) /// /// The interface value to cast /// Spider instance or null if type doesn't match - [GraphInterface] + [GraphQLMember("Spider", true)] public static Spider Spider(this IAnimal value) { if (value.__TypeName == "Spider") diff --git a/test/Linq2GraphQL.TestClient/Generated/Scalars/LocalDate.cs b/test/Linq2GraphQL.TestClient/Generated/Scalars/LocalDate.cs deleted file mode 100644 index ab8249e0..00000000 --- a/test/Linq2GraphQL.TestClient/Generated/Scalars/LocalDate.cs +++ /dev/null @@ -1,18 +0,0 @@ -//--------------------------------------------------------------------- -// 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 System.Text.Json.Serialization; - -namespace Linq2GraphQL.TestClient; - - /// - /// The `LocalDate` scalar type represents a ISO date string, represented as UTF-8 character sequences YYYY-MM-DD. The scalar follows the specification defined in RFC3339 - /// - [JsonConverter(typeof(CustomScalarConverter))] - public partial class LocalDate : CustomScalar {} \ No newline at end of file diff --git a/test/Linq2GraphQL.TestClient/Generated/Types/CollectionSegmentInfo.cs b/test/Linq2GraphQL.TestClient/Generated/Types/CollectionSegmentInfo.cs deleted file mode 100644 index b2605bfe..00000000 --- a/test/Linq2GraphQL.TestClient/Generated/Types/CollectionSegmentInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -//--------------------------------------------------------------------- -// 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; -using Linq2GraphQL.Client; -using Linq2GraphQL.Client.Common; - -namespace Linq2GraphQL.TestClient; - - -/// -/// Information about the offset pagination. -/// -public partial class CollectionSegmentInfo : GraphQLTypeBase -{ - /// - /// Indicates whether more items exist following the set defined by the clients arguments. - /// - [GraphQLMember("hasNextPage")] - [JsonPropertyName("hasNextPage")] - public bool HasNextPage { get; set; } - - /// - /// Indicates whether more items exist prior the set defined by the clients arguments. - /// - [GraphQLMember("hasPreviousPage")] - [JsonPropertyName("hasPreviousPage")] - public bool HasPreviousPage { get; set; } - -} diff --git a/test/Linq2GraphQL.TestClient/Generated/Types/Customer.cs b/test/Linq2GraphQL.TestClient/Generated/Types/Customer.cs index 46e6fd32..e8175442 100644 --- a/test/Linq2GraphQL.TestClient/Generated/Types/Customer.cs +++ b/test/Linq2GraphQL.TestClient/Generated/Types/Customer.cs @@ -52,6 +52,10 @@ public partial class Customer : GraphQLTypeBase [JsonPropertyName("address")] public Address Address { get; set; } + [GraphQLMember("created")] + [JsonPropertyName("created")] + public DateTimeOffset? Created { get; set; } + private LazyProperty> _relatedCustomers = new(); /// /// Do not use in Query, only to retrive result diff --git a/test/Linq2GraphQL.Tests/QueryInterfaceTests.cs b/test/Linq2GraphQL.Tests/QueryInterfaceTests.cs index 674b4862..16207839 100644 --- a/test/Linq2GraphQL.Tests/QueryInterfaceTests.cs +++ b/test/Linq2GraphQL.Tests/QueryInterfaceTests.cs @@ -25,6 +25,7 @@ public async Task Interface_NoSubclass() Assert.IsType(spider); Assert.IsType(pig); + } [Fact] @@ -41,10 +42,11 @@ public async Task Interface_QuerySubClass() var request = await query.GetRequestAsync(); var result = await query.ExecuteAsync(); - var pig = result.First(); - var spider = result.Last(); + var pig = result.First() as Pig; + var spider = result.Last() as Spider; - Assert.IsType(spider); - Assert.IsType(pig); + Assert.NotNull(pig); + Assert.NotNull(spider); + Assert.Equal(11, spider.Speed); } } \ No newline at end of file