diff --git a/src/HotChocolate/Data/src/Data/Filters/Expressions/Handlers/QueryableDefaultFieldHandler.cs b/src/HotChocolate/Data/src/Data/Filters/Expressions/Handlers/QueryableDefaultFieldHandler.cs index c5d2553c2dd..0889fbc081a 100644 --- a/src/HotChocolate/Data/src/Data/Filters/Expressions/Handlers/QueryableDefaultFieldHandler.cs +++ b/src/HotChocolate/Data/src/Data/Filters/Expressions/Handlers/QueryableDefaultFieldHandler.cs @@ -161,6 +161,8 @@ public ReplaceVariableExpressionVisitor( _parameter = parameter; } + protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node; + protected override Expression VisitParameter(ParameterExpression node) { if (node == _parameter) diff --git a/src/HotChocolate/Data/src/Data/Sorting/Expressions/Extensions/QueryableSortContextExtensions.cs b/src/HotChocolate/Data/src/Data/Sorting/Expressions/Extensions/QueryableSortContextExtensions.cs index 6b5bce07590..e0b6e97c678 100644 --- a/src/HotChocolate/Data/src/Data/Sorting/Expressions/Extensions/QueryableSortContextExtensions.cs +++ b/src/HotChocolate/Data/src/Data/Sorting/Expressions/Extensions/QueryableSortContextExtensions.cs @@ -64,6 +64,8 @@ private sealed class OrderingMethodFinder : ExpressionVisitor return base.Visit(node); } + protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node; + protected override Expression VisitMethodCall(MethodCallExpression node) { var name = node.Method.Name; diff --git a/src/HotChocolate/Data/src/Data/Sorting/Expressions/Handlers/QueryableDefaultSortFieldHandler.cs b/src/HotChocolate/Data/src/Data/Sorting/Expressions/Handlers/QueryableDefaultSortFieldHandler.cs index b6933f7a6e7..a57f6e6e166 100644 --- a/src/HotChocolate/Data/src/Data/Sorting/Expressions/Handlers/QueryableDefaultSortFieldHandler.cs +++ b/src/HotChocolate/Data/src/Data/Sorting/Expressions/Handlers/QueryableDefaultSortFieldHandler.cs @@ -117,6 +117,8 @@ public ReplaceVariableExpressionVisitor( _parameter = parameter; } + protected override Expression VisitExtension(Expression node) => node.CanReduce ? base.VisitExtension(node) : node; + protected override Expression VisitParameter(ParameterExpression node) { if (node == _parameter)