diff --git a/src/GraphQL.Client/GraphQLHttpRequest.cs b/src/GraphQL.Client/GraphQLHttpRequest.cs index 00f90d4a..eb3aac14 100644 --- a/src/GraphQL.Client/GraphQLHttpRequest.cs +++ b/src/GraphQL.Client/GraphQLHttpRequest.cs @@ -16,7 +16,7 @@ public GraphQLHttpRequest(string query, object? variables = null, string? operat { } - public GraphQLHttpRequest(GraphQLRequest other): base(other.Query, other.Variables, other.OperationName) + public GraphQLHttpRequest(GraphQLRequest other): base(other) { } diff --git a/src/GraphQL.Primitives/GraphQLRequest.cs b/src/GraphQL.Primitives/GraphQLRequest.cs index 72033552..d471077f 100644 --- a/src/GraphQL.Primitives/GraphQLRequest.cs +++ b/src/GraphQL.Primitives/GraphQLRequest.cs @@ -49,6 +49,8 @@ public GraphQLRequest(string query, object? variables = null, string? operationN OperationName = operationName; } + public GraphQLRequest(GraphQLRequest other): base(other) { } + /// /// Returns a value that indicates whether this instance is equal to a specified object /// @@ -82,16 +84,7 @@ public virtual bool Equals(GraphQLRequest? other) /// /// /// - public override int GetHashCode() - { - unchecked - { - var hashCode = Query.GetHashCode(); - hashCode = (hashCode * 397) ^ OperationName?.GetHashCode() ?? 0; - hashCode = (hashCode * 397) ^ Variables?.GetHashCode() ?? 0; - return hashCode; - } - } + public override int GetHashCode() => (Query, OperationName, Variables).GetHashCode(); /// /// Tests whether two specified instances are equivalent