diff --git a/src/HotChocolate/Core/src/Abstractions/Error.cs b/src/HotChocolate/Core/src/Abstractions/Error.cs index a42e81955c4..df15e64168b 100644 --- a/src/HotChocolate/Core/src/Abstractions/Error.cs +++ b/src/HotChocolate/Core/src/Abstractions/Error.cs @@ -111,28 +111,16 @@ public IError RemoveCode() } /// - 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); /// - public IError WithPath(IReadOnlyList? path) - => WithPath(path is null ? null : Path.FromList(path)); + public IError WithPath(IReadOnlyList path) + => WithPath(Path.FromList(path)); /// - public IError RemovePath() - => new Error(Message, Code, null, Locations, Extensions, Exception); - - /// - public IError WithLocations(IReadOnlyList? locations) - => locations is null - ? RemoveLocations() - : new Error(Message, Code, Path, locations, Extensions, Exception); - - /// - public IError RemoveLocations() - => new Error(Message, Code, Path, null, Extensions, Exception); + public IError WithLocations(IReadOnlyList locations) + => new Error(Message, Code, Path, locations, Extensions, Exception); /// public IError WithExtensions(IReadOnlyDictionary extensions) diff --git a/src/HotChocolate/Core/src/Abstractions/IError.cs b/src/HotChocolate/Core/src/Abstractions/IError.cs index 83b9cff07b6..8961fdd74dd 100644 --- a/src/HotChocolate/Core/src/Abstractions/IError.cs +++ b/src/HotChocolate/Core/src/Abstractions/IError.cs @@ -91,7 +91,7 @@ public interface IError /// Returns a new error that contains all properties of this error /// but with the specified . /// - IError WithPath(Path? path); + IError WithPath(Path path); /// /// Creates a new error that contains all properties of this error @@ -104,17 +104,7 @@ public interface IError /// Returns a new error that contains all properties of this error /// but with the specified . /// - IError WithPath(IReadOnlyList? path); - - /// - /// Creates a new error that contains all properties of this error - /// but with the removed. - /// - /// - /// Returns a new error that contains all properties of this error - /// but with the removed. - /// - IError RemovePath(); + IError WithPath(IReadOnlyList path); /// /// Creates a new error that contains all properties of this error @@ -128,17 +118,7 @@ public interface IError /// Returns a new error that contains all properties of this error /// but with the specified . /// - IError WithLocations(IReadOnlyList? locations); - - /// - /// Creates a new error that contains all properties of this error - /// but with the removed. - /// - /// - /// Returns a new error that contains all properties of this error - /// but with the removed. - /// - IError RemoveLocations(); + IError WithLocations(IReadOnlyList locations); /// /// Creates a new error that contains all properties of this error