-
-
Notifications
You must be signed in to change notification settings - Fork 799
Open
Labels
Description
Product
Hot Chocolate
Version
15.1.11
Link to minimal reproduction
https://github.com/NielsAudoor/hot-chocolate-ef-translation-poc
Steps to reproduce
- Run the API project.
- Run the following query:
query events { events(order: [ { timestamp: DESC }]){ timestamp } }
What is expected?
The query should work as normal and be sorted.
What is actually happening?
The query fails when trying to apply the sorting because it takes the e.Timestamp.DateTime in the OrderBy while it should be e.Timestamp.
Relevant log output
The LINQ expression 'DbSet<Event>()\r\n .OrderByDescending(e => e.Timestamp.DateTime)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.Additional context
No response
ryanbacon and VDBBjorn