Projection is not working for JSON polymorphic types #8578
vvitkovsky
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello HotChocolate experts.
I would like to ask about one issue I met. I have those models:
and those type definitions for GraphQL:
Then I use it in a query with pagination, sorting, projection and filtering:
If I try to perform a query, it fails with an error System.InvalidOperationException: 'Operation is not valid due to the current state of the object.'. If I remove UseProjection, it works fine, and I can retrieve objects of both types like this:
So, my question is - is it possible to make a projection to work for JSON polymorphic types?
I am using MongoDB over Entity Framework behind, tried also to use MongoDB integration wih HotChocolate - it doesn't work either.
Best regards,
Victor
Beta Was this translation helpful? Give feedback.
All reactions