From 4d6b7b7c1c29c23958dc32e59469a410face0baf Mon Sep 17 00:00:00 2001 From: jonasessen Date: Fri, 27 Mar 2026 12:59:52 +0100 Subject: [PATCH] Convert GraphQLRequest and ArgumentValue to record types --- src/Linq2GraphQL.Client/ArgumentValue.cs | 10 +++++----- src/Linq2GraphQL.Client/GraphQLRequest.cs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Linq2GraphQL.Client/ArgumentValue.cs b/src/Linq2GraphQL.Client/ArgumentValue.cs index f7b51511..9c01eed6 100644 --- a/src/Linq2GraphQL.Client/ArgumentValue.cs +++ b/src/Linq2GraphQL.Client/ArgumentValue.cs @@ -1,6 +1,6 @@ namespace Linq2GraphQL.Client; -public class ArgumentValue +public record ArgumentValue { public ArgumentValue(string graphName, string graphType, object value) { @@ -10,8 +10,8 @@ public ArgumentValue(string graphName, string graphType, object value) VariableName = graphName; } - public string GraphName { get; set; } - public string GraphType { get; set; } - public object Value { get; set; } - public string VariableName { get; set; } + public string GraphName { get; init; } + public string GraphType { get; init; } + public object Value { get; init; } + public string VariableName { get; set; } // mutable: unique suffix appended during query building } \ No newline at end of file diff --git a/src/Linq2GraphQL.Client/GraphQLRequest.cs b/src/Linq2GraphQL.Client/GraphQLRequest.cs index b60f063b..98354541 100644 --- a/src/Linq2GraphQL.Client/GraphQLRequest.cs +++ b/src/Linq2GraphQL.Client/GraphQLRequest.cs @@ -2,9 +2,9 @@ namespace Linq2GraphQL.Client; -public class GraphQLRequest +public record GraphQLRequest { - [JsonPropertyName("query")] public string Query { get; set; } + [JsonPropertyName("query")] public string Query { get; init; } - [JsonPropertyName("variables")] public Dictionary Variables { get; set; } + [JsonPropertyName("variables")] public Dictionary Variables { get; init; } } \ No newline at end of file