Skip to content

Commit abf006d

Browse files
authored
Merge pull request #185 from graphql-dotnet/develop
fix stack overflow in equality comparer
2 parents b5750ed + a727000 commit abf006d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GraphQL.Primitives/GraphQLRequest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Linq;
34
using System.Runtime.Serialization;
45

56
namespace GraphQL {
@@ -64,7 +65,7 @@ public override bool Equals(object? obj) {
6465
public virtual bool Equals(GraphQLRequest? other) {
6566
if (ReferenceEquals(null, other)) return false;
6667
if (ReferenceEquals(this, other)) return true;
67-
return EqualityComparer<Dictionary<string,object>>.Default.Equals(this, other);
68+
return this.Count == other.Count && !this.Except(other).Any();
6869
}
6970

7071
/// <summary>

0 commit comments

Comments
 (0)