Skip to content

Commit

Permalink
Fixed WithLocation on SchemaDefinitionNode (#4964)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsinghammer committed Apr 13, 2022
1 parent a5d4be3 commit dfe0a4d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public override bool Equals(object? obj)
/// hashing algorithms and data structures such as a hash table.
/// </returns>
public override int GetHashCode()
=> HashCode.Combine(Kind, Element?.GetHashCode());
=> HashCode.Combine(Kind, Element);

public static bool operator ==(
OptionalModifierNode? left,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace HotChocolate.Language;
/// <summary>
/// <para>Represents the scalar definition syntax.</para>
/// <para>
/// Scalar types represent primitive leaf values in a GraphQL type system.
/// Scalar types represent primitive leaf values in a GraphQL type system.
/// GraphQL responses take the form of a hierarchical tree;
/// the leaves of this tree are typically GraphQL Scalar types
/// (but may also be Enum types or null values).
Expand Down Expand Up @@ -182,7 +182,7 @@ public override bool Equals(object? obj)
/// hashing algorithms and data structures such as a hash table.
/// </returns>
public override int GetHashCode()
=> HashCode.Combine(base.GetHashCode(), Kind, Description?.GetHashCode());
=> HashCode.Combine(base.GetHashCode(), Kind, Description);

/// <summary>
/// The equal operator.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public IEnumerable<ISyntaxNode> GetNodes()
public SchemaDefinitionNode WithLocation(Location? location)
{
return new SchemaDefinitionNode(
Location, Description, Directives, OperationTypes);
location, Description, Directives, OperationTypes);
}

public SchemaDefinitionNode WithDirectives(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public IEnumerable<ISyntaxNode> GetNodes()
public SchemaExtensionNode WithLocation(Location? location)
{
return new SchemaExtensionNode(
Location, Directives, OperationTypes);
location, Directives, OperationTypes);
}

public SchemaExtensionNode WithDirectives(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ public SelectionSetNode WithLocation(Location? location)
throw new ArgumentNullException(nameof(selection));
}

var selections = new List<ISelectionNode>(Selections);
selections.Add(selection);
var selections = new List<ISelectionNode>(Selections) { selection };

return new SelectionSetNode(
Location, selections);
Expand Down

0 comments on commit dfe0a4d

Please sign in to comment.