You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker compose up -d to start the ephemeral database (no persistant volume, defaults to port 5433).
dotnet ef database update
dotnet run
Run the following GraphQL query:
query {
speakers {
nodes {
name
}
}
}
Exception is thrown:
Property 'System.String Name2' is not defined for type 'HotChocolateIssueReproduction.Types.SpeakerDto' (Parameter 'property')
What is expected?
When OrderBy expressions exist in the Selector, they should not be automatically selected by QueryHelpers.EnsureOrderPropsAreSelected();
What is actually happening?
The following expression contains an OrderBy that causes QueryHelpers.EnsureOrderPropsAreSelected to attempt to select OtherProperty, which does not exist on the Dto.
e =>newDto{Id=e.Id,NotWorking=e.ListOfObjects.OrderByDescending(l =>l.OtherProperty).FirstOrDefault()});
Relevant log output
message: Property 'System.String Name2' is not defined fortype'HotChocolateIssueReproduction.Types.SpeakerDto' (Parameter 'property')
stackTrace: " at System.Linq.Expressions.Expression.Property(Expression expression, PropertyInfo property)\r \ at GreenDonut.Data.Expressions.QueryHelpers.AddPropertiesVisitorRewriter.V\ isitMemberInit(MemberInitExpression node)\r \ at GreenDonut.Data.Expressions.QueryHelpers.AddPropertiesInSelector[T](Exp\ ression`1 selector, List`1 properties)\r \ at GreenDonut.Data.Expressions.QueryHelpers.EnsureOrderPropsAreSelected[T]\ (IQueryable`1 query)\r\ at GreenDonut.Data.PagingQueryableExtensions.ToPageAsync[T](IQueryable`1 source, PagingArguments arguments, Boolean includeTotalCount, CancellationToken cancellationToken)\r\ at GreenDonut.Data.PagingQueryableExtensions.ToPageAsync[T](IQueryable`1 source, PagingArguments arguments, CancellationToken cancellationToken)\r
Additional context
No response
The text was updated successfully, but these errors were encountered:
Product
Green Donut
Version
15.1.3
Link to minimal reproduction
https://github.com/Tommsy64/HotChocolate-IssueReproductions/tree/88256b4db5a1a60196bb23e249da85dec8732a66
Steps to reproduce
docker compose up -d
to start the ephemeral database (no persistant volume, defaults to port5433
).dotnet ef database update
dotnet run
Exception is thrown:
What is expected?
When OrderBy expressions exist in the Selector, they should not be automatically selected by
QueryHelpers.EnsureOrderPropsAreSelected();
What is actually happening?
The following expression contains an
OrderBy
that causesQueryHelpers.EnsureOrderPropsAreSelected
to attempt to selectOtherProperty
, which does not exist on theDto
.Relevant log output
Additional context
No response
The text was updated successfully, but these errors were encountered: