Paulo Amf
Paulo Amf

Reputation: 358

HotChocolate GraphQL (.NET Core) How to drill down nested Classes

I am new to GraphQL. I am testing HotChocolate following a simple article and seems that was easy to drill down to nested classes using [UseSelection] annotation in the Resolvers, however, I am using V11 and I realize did no work anymore, I would love to know how to simply drill down to nested classes using V11 like this:

query { customers { name departments { name } }

Thank you

Upvotes: 1

Views: 3178

Answers (1)

Paulo Amf
Paulo Amf

Reputation: 358

I found the solution on HotChocolate Slack Channel. It is basically still the same but classes are in a different package and had been renamed. The way to go is using Projections: https://chillicream.com/docs/hotchocolate/fetching-data/projections/

Also, it is interesting to read this article, if you are planing or using EntityFramework: https://chillicream.com/docs/hotchocolate/integrations/entity-framework/

Thank You anyways

Upvotes: 3

Related Questions