DEV Community

Discussion on: Get started with GraphQL and Entity Framework

Collapse
 
maldworth profile image
maldworth • Edited

Great tutorial @michaelstaib . The only concern I have is your DB Entities (Domain Models) are being exposed through the graphql schema. Is there any pattern you use to hide them? Maybe you have a GraphQL Gateway? Mobile -> BFF (GraphQL with stitching) -> contoso microservice (graphQL + EFCore as shown above)?

This would mean that in addition to stitching, you would have your "view models" which map from the domain models at this BFF graphql, to not expose any database fields you don't want to?

Collapse
 
michaelstaib profile image
Michael Staib

There are actually easier ways to do that :) This example was only to show how you can couple filtering in hc with your ef context. When planning for a proper project I would not couple my schema to the DB and also think about various other approaches. We have a great slack channel ... so I encourage you to join we have lots of schema design discussions there.