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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/GraphQL.Client/GraphQLHttpRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down
13 changes: 3 additions & 10 deletions src/GraphQL.Primitives/GraphQLRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public GraphQLRequest(string query, object? variables = null, string? operationN
OperationName = operationName;
}

public GraphQLRequest(GraphQLRequest other): base(other) { }

/// <summary>
/// Returns a value that indicates whether this instance is equal to a specified object
/// </summary>
Expand Down Expand Up @@ -82,16 +84,7 @@ public virtual bool Equals(GraphQLRequest? other)
/// <summary>
/// <inheritdoc cref="object.GetHashCode"/>
/// </summary>
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();

/// <summary>
/// Tests whether two specified <see cref="GraphQLRequest"/> instances are equivalent
Expand Down