Skip to content

Commit

Permalink
Replace not null or empty scope guards with custom message to regular…
Browse files Browse the repository at this point in the history
… ones
  • Loading branch information
AntonC9018 committed Dec 19, 2023
1 parent 62a13cf commit fffee44
Showing 1 changed file with 5 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,7 @@ public static IEntityResolverDescriptor Key(
bool? resolvable = null)
{
ArgumentNullException.ThrowIfNull(descriptor);

if (string.IsNullOrEmpty(fieldSet))
{
throw new ArgumentException(
FieldDescriptorExtensions_Key_FieldSet_CannotBeNullOrEmpty,
nameof(fieldSet));
}
ArgumentException.ThrowIfNullOrEmpty(fieldSet);

var arguments = CreateKeyArgumentNodes(fieldSet, resolvable);

Expand All @@ -268,13 +262,7 @@ public static IInterfaceTypeDescriptor Key(
bool? resolvable = null)
{
ArgumentNullException.ThrowIfNull(descriptor);

if (string.IsNullOrEmpty(fieldSet))
{
throw new ArgumentException(
FieldDescriptorExtensions_Key_FieldSet_CannotBeNullOrEmpty,
nameof(fieldSet));
}
ArgumentException.ThrowIfNullOrEmpty(fieldSet);

var arguments = CreateKeyArgumentNodes(fieldSet, resolvable);

Expand Down Expand Up @@ -446,13 +434,7 @@ public static IObjectFieldDescriptor Provides(
string fieldSet)
{
ArgumentNullException.ThrowIfNull(descriptor);

if (string.IsNullOrEmpty(fieldSet))
{
throw new ArgumentException(
FieldDescriptorExtensions_Provides_FieldSet_CannotBeNullOrEmpty,
nameof(fieldSet));
}
ArgumentException.ThrowIfNullOrEmpty(fieldSet);

return descriptor.Directive(
WellKnownTypeNames.Provides,
Expand Down Expand Up @@ -500,13 +482,7 @@ public static IObjectFieldDescriptor Requires(
string fieldSet)
{
ArgumentNullException.ThrowIfNull(descriptor);

if (string.IsNullOrEmpty(fieldSet))
{
throw new ArgumentException(
FieldDescriptorExtensions_Requires_FieldSet_CannotBeNullOrEmpty,
nameof(fieldSet));
}
ArgumentException.ThrowIfNullOrEmpty(fieldSet);

return descriptor.Directive(
WellKnownTypeNames.Requires,
Expand Down Expand Up @@ -614,13 +590,7 @@ public static IEntityResolverDescriptor<T> Key<T>(
string fieldSet)
{
ArgumentNullException.ThrowIfNull(descriptor);

if (string.IsNullOrEmpty(fieldSet))
{
throw new ArgumentException(
FieldDescriptorExtensions_Key_FieldSet_CannotBeNullOrEmpty,
nameof(fieldSet));
}
ArgumentException.ThrowIfNullOrEmpty(fieldSet);

descriptor.Directive(
WellKnownTypeNames.Key,
Expand Down

0 comments on commit fffee44

Please sign in to comment.