Skip to content

Commit b05d9fd

Browse files
committed
remove null checks
1 parent 8fd3da8 commit b05d9fd

18 files changed

Lines changed: 0 additions & 46 deletions

src/GraphQL.EntityFramework/EfDocumentExecuter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ public class EfDocumentExecuter :
88
{
99
protected override IExecutionStrategy SelectExecutionStrategy(ExecutionContext context)
1010
{
11-
Guard.AgainstNull(nameof(context), context);
1211
if (context.Operation.OperationType == OperationType.Query)
1312
{
1413
return new SerialExecutionStrategy();

src/GraphQL.EntityFramework/EfGraphQLConventions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ public static void RegisterInContainer<TDbContext>(
3131

3232
where TDbContext : DbContext
3333
{
34-
Guard.AgainstNull(nameof(services), services);
35-
3634
RegisterScalarsAndArgs(services);
3735
services.AddHttpContextAccessor();
3836
services.AddTransient<HttpContextCapture>();
@@ -90,7 +88,6 @@ static void RegisterScalarsAndArgs(IServiceCollection services)
9088

9189
public static void RegisterConnectionTypesInContainer(IServiceCollection services)
9290
{
93-
Guard.AgainstNull(nameof(services), services);
9491
services.AddTransient(typeof(ConnectionType<>));
9592
services.AddTransient(typeof(EdgeType<>));
9693
services.AddSingleton<PageInfoType>();

src/GraphQL.EntityFramework/Filters/Filters.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public delegate Task<bool> AsyncFilter<in TEntity>(object userContext, TEntity i
2020
public void Add<TEntity>(Filter<TEntity> filter)
2121
where TEntity : class
2222
{
23-
Guard.AgainstNull(nameof(filter), filter);
2423
funcs[typeof(TEntity)] =
2524
(context, item) =>
2625
{
@@ -38,7 +37,6 @@ public void Add<TEntity>(Filter<TEntity> filter)
3837
public void Add<TEntity>(AsyncFilter<TEntity> filter)
3938
where TEntity : class
4039
{
41-
Guard.AgainstNull(nameof(filter), filter);
4240
funcs[typeof(TEntity)] =
4341
async (context, item) =>
4442
{

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ public EfGraphQLService(
2222
ResolveFilters? resolveFilters = null,
2323
bool disableTracking = false)
2424
{
25-
Guard.AgainstNull(nameof(model), model);
26-
Guard.AgainstNull(nameof(resolveDbContext), resolveDbContext);
2725
this.resolveFilters = resolveFilters;
2826
this.disableTracking = disableTracking;
2927

@@ -72,7 +70,6 @@ ResolveEfFieldContext<TDbContext, TSource> BuildContext<TSource>(
7270

7371
public TDbContext ResolveDbContext(IResolveFieldContext context)
7472
{
75-
Guard.AgainstNull(nameof(context), context);
7673
return resolveDbContext(context.UserContext);
7774
}
7875

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Navigation.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public FieldType AddNavigationField<TSource, TReturn>(
1818
string? description = null)
1919
where TReturn : class
2020
{
21-
Guard.AgainstNull(nameof(graph), graph);
2221
Guard.AgainstNullWhiteSpace(nameof(name), name);
2322

2423
graphType ??= GraphTypeFinder.FindGraphType<TReturn>();

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationConnection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ public void AddNavigationConnectionField<TSource, TReturn>(
2525
string? description = null)
2626
where TReturn : class
2727
{
28-
Guard.AgainstNull(nameof(graph), graph);
29-
3028
Guard.AgainstNullWhiteSpace(nameof(name), name);
3129
Guard.AgainstNegative(nameof(pageSize), pageSize);
3230

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_NavigationList.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public FieldType AddNavigationListField<TSource, TReturn>(
1919
string? description = null)
2020
where TReturn : class
2121
{
22-
Guard.AgainstNull(nameof(graph), graph);
2322
Guard.AgainstNullWhiteSpace(nameof(name), name);
2423

2524
var hasId = keyNames.ContainsKey(typeof(TReturn));

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Queryable.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public FieldType AddQueryField<TReturn>(
1919
string? description = null)
2020
where TReturn : class
2121
{
22-
Guard.AgainstNull(nameof(graph), graph);
2322
var field = BuildQueryField(graphType, name, resolve, arguments, description);
2423
return graph.AddField(field);
2524
}
@@ -33,7 +32,6 @@ public FieldType AddQueryField<TSource, TReturn>(
3332
string? description = null)
3433
where TReturn : class
3534
{
36-
Guard.AgainstNull(nameof(graph), graph);
3735
var field = BuildQueryField(itemGraphType, name, resolve, arguments, description);
3836
return graph.AddField(field);
3937
}

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_QueryableConnection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public void AddQueryConnectionField<TReturn>(
2020
string? description = null)
2121
where TReturn : class
2222
{
23-
Guard.AgainstNull(nameof(graph), graph);
2423
BuildQueryConnectionField(graph, name, resolve, arguments, pageSize, itemGraphType, description);
2524
}
2625

@@ -34,7 +33,6 @@ public void AddQueryConnectionField<TSource, TReturn>(
3433
string? description = null)
3534
where TReturn : class
3635
{
37-
Guard.AgainstNull(nameof(graph), graph);
3836
BuildQueryConnectionField(graph, name, resolve, arguments, pageSize, itemGraphType, description);
3937
}
4038

src/GraphQL.EntityFramework/GraphApi/EfGraphQLService_Single.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ public FieldType AddSingleField<TReturn>(
2222
string? description = null)
2323
where TReturn : class
2424
{
25-
Guard.AgainstNull(nameof(graph), graph);
2625
var field = BuildSingleField(name, resolve, mutate, arguments, graphType, nullable, description);
2726
return graph.AddField(field);
2827
}
@@ -38,7 +37,6 @@ public FieldType AddSingleField<TReturn>(
3837
string? description = null)
3938
where TReturn : class
4039
{
41-
Guard.AgainstNull(nameof(graph), graph);
4240
var field = BuildSingleField(name, resolve, mutate, arguments, graphType, nullable, description);
4341
return graph.AddField(field);
4442
}
@@ -54,7 +52,6 @@ public FieldType AddSingleField<TSource, TReturn>(
5452
string? description = null)
5553
where TReturn : class
5654
{
57-
Guard.AgainstNull(nameof(graph), graph);
5855
var field = BuildSingleField(name, resolve, mutate, arguments, graphType, nullable, description);
5956
return graph.AddField(field);
6057
}
@@ -70,7 +67,6 @@ FieldType BuildSingleField<TSource, TReturn>(
7067
where TReturn : class
7168
{
7269
Guard.AgainstNullWhiteSpace(nameof(name), name);
73-
Guard.AgainstNull(nameof(resolve), resolve);
7470

7571
graphType ??= GraphTypeFinder.FindGraphType<TReturn>(nullable);
7672

0 commit comments

Comments
 (0)