diff --git a/src/TypeCache.GraphQL/Attributes/GraphQLDeprecationReasonAttribute.cs b/src/TypeCache.GraphQL/Attributes/GraphQLDeprecationReasonAttribute.cs
index 57e00cc9..adc83f4c 100644
--- a/src/TypeCache.GraphQL/Attributes/GraphQLDeprecationReasonAttribute.cs
+++ b/src/TypeCache.GraphQL/Attributes/GraphQLDeprecationReasonAttribute.cs
@@ -13,7 +13,7 @@ public sealed class GraphQLDeprecationReasonAttribute : Attribute
{
public GraphQLDeprecationReasonAttribute(string deprecationReason)
{
- deprecationReason.AssertNotBlank();
+ deprecationReason.ThrowIfBlank();
this.DeprecationReason = deprecationReason;
}
diff --git a/src/TypeCache.GraphQL/Attributes/GraphQLDescriptionAttribute.cs b/src/TypeCache.GraphQL/Attributes/GraphQLDescriptionAttribute.cs
index 1a16b76c..c510acda 100644
--- a/src/TypeCache.GraphQL/Attributes/GraphQLDescriptionAttribute.cs
+++ b/src/TypeCache.GraphQL/Attributes/GraphQLDescriptionAttribute.cs
@@ -13,7 +13,7 @@ public sealed class GraphQLDescriptionAttribute : Attribute
{
public GraphQLDescriptionAttribute(string description)
{
- description.AssertNotBlank();
+ description.ThrowIfBlank();
this.Description = description;
}
diff --git a/src/TypeCache.GraphQL/Attributes/GraphQLInputNameAttribute.cs b/src/TypeCache.GraphQL/Attributes/GraphQLInputNameAttribute.cs
index 900361e1..b15a7fa1 100644
--- a/src/TypeCache.GraphQL/Attributes/GraphQLInputNameAttribute.cs
+++ b/src/TypeCache.GraphQL/Attributes/GraphQLInputNameAttribute.cs
@@ -14,7 +14,7 @@ public sealed class GraphQLInputNameAttribute : Attribute
///
public GraphQLInputNameAttribute(string name)
{
- name.AssertNotBlank();
+ name.ThrowIfBlank();
this.Name = name;
}
diff --git a/src/TypeCache.GraphQL/Attributes/GraphQLNameAttribute.cs b/src/TypeCache.GraphQL/Attributes/GraphQLNameAttribute.cs
index 85978628..37b06687 100644
--- a/src/TypeCache.GraphQL/Attributes/GraphQLNameAttribute.cs
+++ b/src/TypeCache.GraphQL/Attributes/GraphQLNameAttribute.cs
@@ -14,7 +14,7 @@ public sealed class GraphQLNameAttribute : Attribute
///
public GraphQLNameAttribute(string name)
{
- name.AssertNotBlank();
+ name.ThrowIfBlank();
this.Name = name;
}
diff --git a/src/TypeCache.GraphQL/Extensions/GraphQLExtensions.cs b/src/TypeCache.GraphQL/Extensions/GraphQLExtensions.cs
index e208c7a2..cbaff4b3 100644
--- a/src/TypeCache.GraphQL/Extensions/GraphQLExtensions.cs
+++ b/src/TypeCache.GraphQL/Extensions/GraphQLExtensions.cs
@@ -183,8 +183,8 @@ public static Type ToGraphQLType(this Type @this, bool isInputType)
return @this.ToGraphQLEnumType();
var objectType = @this.GetObjectType();
- (objectType is ObjectType.Delegate).AssertFalse();
- (objectType is ObjectType.Object).AssertFalse();
+ (objectType is ObjectType.Delegate).ThrowIfTrue();
+ (objectType is ObjectType.Object).ThrowIfTrue();
var scalarGraphType = @this.GetScalarType().ToGraphType();
if (scalarGraphType is not null)
diff --git a/src/TypeCache.GraphQL/Extensions/ResolveFieldContextExtensions.cs b/src/TypeCache.GraphQL/Extensions/ResolveFieldContextExtensions.cs
index 8f7a6054..aedba7b8 100644
--- a/src/TypeCache.GraphQL/Extensions/ResolveFieldContextExtensions.cs
+++ b/src/TypeCache.GraphQL/Extensions/ResolveFieldContextExtensions.cs
@@ -13,7 +13,7 @@ public static class ResolveFieldContextExtensions
{
public static DataTable GetArgumentAsDataTable(this IResolveFieldContext @this, string name, ObjectSchema objectSchema)
{
- name.AssertNotBlank();
+ name.ThrowIfBlank();
var table = objectSchema.CreateDataTable();
var arguments = @this.GetArgument>>(name).ToArray();
diff --git a/src/TypeCache.GraphQL/Extensions/SchemaExtensions.cs b/src/TypeCache.GraphQL/Extensions/SchemaExtensions.cs
index f5e56ea9..9917887a 100644
--- a/src/TypeCache.GraphQL/Extensions/SchemaExtensions.cs
+++ b/src/TypeCache.GraphQL/Extensions/SchemaExtensions.cs
@@ -7,7 +7,6 @@
using GraphQL.Types;
using Microsoft.Extensions.DependencyInjection;
using TypeCache.Attributes;
-using TypeCache.Collections;
using TypeCache.Data;
using TypeCache.Data.Extensions;
using TypeCache.Extensions;
@@ -16,6 +15,7 @@
using TypeCache.GraphQL.Resolvers;
using TypeCache.GraphQL.SqlApi;
using TypeCache.GraphQL.Types;
+using TypeCache.Utilities;
namespace TypeCache.GraphQL.Extensions;
@@ -59,7 +59,7 @@ public static FieldType[] AddDatabaseSchemaQueries(this ISchema @this, IDataSour
///
public static FieldType AddDatabaseSchemaQuery(this ISchema @this, IDataSource dataSource, SchemaCollection collection)
{
- dataSource.AssertNotNull();
+ dataSource.ThrowIfNull();
var table = dataSource.GetDatabaseSchema(collection);
var graphDatabasesEnum = new EnumerationGraphType
{
@@ -136,7 +136,7 @@ public static void AddDatabaseEndpoints(this ISchema @this, IDataSource dataSour
const string ColumnName = nameof(ColumnName);
const string ColumnType = nameof(ColumnType);
- dataSource.AssertNotNull();
+ dataSource.ThrowIfNull();
database ??= dataSource.DefaultDatabase;
var objectSchemas = dataSource.ObjectSchemas.Values.ToArray();
@@ -830,8 +830,8 @@ public static void AddSqlApiEndpoints(this ISchema @this, IDataSource dataSou
public static FieldType AddSqlApiCallProcedureEndpoint(this ISchema @this, IDataSource dataSource, string procedure, bool mutation, string? graphQlName = null, IGraphType? graphQlType = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- procedure.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ procedure.ThrowIfBlank();
var name = dataSource.Escape(procedure);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -875,8 +875,8 @@ public static FieldType AddSqlApiCallProcedureEndpoint(this ISchema @this, ID
public static FieldType AddSqlApiDeleteDataEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -910,8 +910,8 @@ public static FieldType AddSqlApiDeleteDataEndpoint(this ISchema @this, IData
public static FieldType AddSqlApiDeleteEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -946,8 +946,8 @@ public static FieldType AddSqlApiDeleteEndpoint(this ISchema @this, IDataSour
public static FieldType AddSqlApiInsertDataEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -982,8 +982,8 @@ public static FieldType AddSqlApiInsertDataEndpoint(this ISchema @this, IData
public static FieldType AddSqlApiInsertEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -1040,8 +1040,8 @@ public static FieldType AddSqlApiInsertEndpoint(this ISchema @this, IDataSour
public static FieldType AddSqlApiSelectEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -1095,8 +1095,8 @@ public static FieldType AddSqlApiSelectEndpoint(this ISchema @this, IDataSour
public static FieldType AddSqlApiUpdateDataEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
@@ -1130,8 +1130,8 @@ public static FieldType AddSqlApiUpdateDataEndpoint(this ISchema @this, IData
public static FieldType AddSqlApiUpdateEndpoint(this ISchema @this, IDataSource dataSource, string table, string? graphQlName = null)
where T : notnull, new()
{
- dataSource.AssertNotNull();
- table.AssertNotBlank();
+ dataSource.ThrowIfNull();
+ table.ThrowIfBlank();
var name = dataSource.Escape(table);
var objectSchema = dataSource.ObjectSchemas[name];
diff --git a/src/TypeCache.GraphQL/Resolvers/BatchLoaderFieldResolver.cs b/src/TypeCache.GraphQL/Resolvers/BatchLoaderFieldResolver.cs
index ffe38af0..0b0de93b 100644
--- a/src/TypeCache.GraphQL/Resolvers/BatchLoaderFieldResolver.cs
+++ b/src/TypeCache.GraphQL/Resolvers/BatchLoaderFieldResolver.cs
@@ -4,9 +4,9 @@
using GraphQL;
using GraphQL.DataLoader;
using Microsoft.Extensions.DependencyInjection;
-using TypeCache.Collections;
using TypeCache.Extensions;
using TypeCache.GraphQL.Extensions;
+using TypeCache.Utilities;
using IResolveFieldContext = global::GraphQL.IResolveFieldContext;
namespace TypeCache.GraphQL.Resolvers;
@@ -24,10 +24,10 @@ public sealed class BatchLoaderFieldResolver : FieldResolv
///
public BatchLoaderFieldResolver(MethodInfo methodInfo, Func getParentKey, Func getChildKey, bool returnCollection)
{
- methodInfo.AssertNotNull();
- getParentKey.AssertNotNull();
- getChildKey.AssertNotNull();
- methodInfo.ReturnType.IsAny, Task, Task>, ValueTask, ValueTask>>().AssertTrue();
+ methodInfo.ThrowIfNull();
+ getParentKey.ThrowIfNull();
+ getChildKey.ThrowIfNull();
+ methodInfo.ReturnType.IsAny, Task, Task>, ValueTask, ValueTask>>().ThrowIfFalse();
this._DataLoaderKey = Invariant($"{typeof(PARENT).GraphQLName()}.{methodInfo.GraphQLName()}");
this._MethodInfo = methodInfo;
@@ -39,11 +39,11 @@ public BatchLoaderFieldResolver(MethodInfo methodInfo, Func getPa
///
protected override async ValueTask