Skip to content

Commit

Permalink
remove unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
greaterwill committed Dec 19, 2024
1 parent 61f1f59 commit 6d809b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 41 deletions.
24 changes: 6 additions & 18 deletions src/HotChocolate/Core/src/Abstractions/Error.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,28 +111,16 @@ public IError RemoveCode()
}

/// <inheritdoc />
public IError WithPath(Path? path)
=> path is null
? RemovePath()
: new Error(Message, Code, path, Locations, Extensions, Exception);
public IError WithPath(Path path)
=> new Error(Message, Code, path, Locations, Extensions, Exception);

/// <inheritdoc />
public IError WithPath(IReadOnlyList<object>? path)
=> WithPath(path is null ? null : Path.FromList(path));
public IError WithPath(IReadOnlyList<object> path)
=> WithPath(Path.FromList(path));

/// <inheritdoc />
public IError RemovePath()
=> new Error(Message, Code, null, Locations, Extensions, Exception);

/// <inheritdoc />
public IError WithLocations(IReadOnlyList<Location>? locations)
=> locations is null
? RemoveLocations()
: new Error(Message, Code, Path, locations, Extensions, Exception);

/// <inheritdoc />
public IError RemoveLocations()
=> new Error(Message, Code, Path, null, Extensions, Exception);
public IError WithLocations(IReadOnlyList<Location> locations)
=> new Error(Message, Code, Path, locations, Extensions, Exception);

/// <inheritdoc />
public IError WithExtensions(IReadOnlyDictionary<string, object?> extensions)
Expand Down
26 changes: 3 additions & 23 deletions src/HotChocolate/Core/src/Abstractions/IError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public interface IError
/// Returns a new error that contains all properties of this error
/// but with the specified <paramref name="path" />.
/// </returns>
IError WithPath(Path? path);
IError WithPath(Path path);

/// <summary>
/// Creates a new error that contains all properties of this error
Expand All @@ -104,17 +104,7 @@ public interface IError
/// Returns a new error that contains all properties of this error
/// but with the specified <paramref name="path" />.
/// </returns>
IError WithPath(IReadOnlyList<object>? path);

/// <summary>
/// Creates a new error that contains all properties of this error
/// but with the <see cref="Path"/> removed.
/// </summary>
/// <returns>
/// Returns a new error that contains all properties of this error
/// but with the <see cref="Path"/> removed.
/// </returns>
IError RemovePath();
IError WithPath(IReadOnlyList<object> path);

/// <summary>
/// Creates a new error that contains all properties of this error
Expand All @@ -128,17 +118,7 @@ public interface IError
/// Returns a new error that contains all properties of this error
/// but with the specified <paramref name="locations" />.
/// </returns>
IError WithLocations(IReadOnlyList<Location>? locations);

/// <summary>
/// Creates a new error that contains all properties of this error
/// but with the <see cref="Locations"/> removed.
/// </summary>
/// <returns>
/// Returns a new error that contains all properties of this error
/// but with the <see cref="Locations"/> removed.
/// </returns>
IError RemoveLocations();
IError WithLocations(IReadOnlyList<Location> locations);

/// <summary>
/// Creates a new error that contains all properties of this error
Expand Down

0 comments on commit 6d809b5

Please sign in to comment.