Open Torellonik opened 1 year ago
I too had this issue, after some searching I found the comment https://github.com/ChilliCream/graphql-platform/issues/4114#issuecomment-1518695940 by BlackDice051 and applied the code at the bottom, effectively replacing the HotChocolate AutoMapper integration. Hopefully this (or a similar fix) can be integrated into the offical HotChocolate.Data.AutoMapper
package
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
We experienced issues with GraphQL HotChocolate
UseProjection
attribute after Automapper upgrade to version 12.0.1 (last one working version was 10.1.1).Here's our simplified context:
RentComponent and RentSection entity classes
RentResponse and RentSectionResponse DTO classes
Mapping profile
Resolver
Making a following query:
The filter recognizes all selections, but generates a query to select only
Id
And that is obviously causing errors in retrieving data since
Name
is not nullable in response DTO, but it's not retrieved.We tried to downgrade to Automapper 10.1.1 that seems the last compatible version and i obtained following (right and expected) result:
We also noticed that there are some similar open issue. We tried to follow the steps written here and here but nothing worked.
Steps to reproduce
.ForAllMember(o => o.ExplicitExpansion())
UseProjection
attribute to it.Relevant log output
Additional Context?
Notice that by removing
ExplicitExpansion
from mapping profiles, the data is retrieved due to the fact that a complete (without projection) SQL query is generated.Version
12.5.2