C
C#16mo ago
Denis

❔ GraphQL + EF Core

Hello! I'd love to ask whether it is a good idea to implement a GraphQL API for accessing a database+EF Core? Is it even a good idea to consider GraphQL, or it was over hyped and fell off? As far as I understood, this API tech allows you to specify exactly what data you need - no unnecessary data provided by a request/no need to sent multiple requests. Is it possible to automatically build EF Core queries based on the GraphQL query? Or am I completely misunderstanding something/have unrealistic expectations? I wish to use it for internal communication between applications. For external clients wishing to automate the application, I'd stick to classic REST API - feel free to suggest a better approach
8 Replies
Saber
Saber16mo ago
yes look at hotchocolate
Denis
Denis16mo ago
I suppose 'yes' means it is possible. But is it a good idea? Are there any gotchas that make this approach not so appealing, and I should opt for, e.g., gRPC?
Saber
Saber16mo ago
its all going to depend on the use case and requirements.
mindhardt
mindhardt16mo ago
$itdepends
Accord
Accord16mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
acookook
acookook6mo ago
I am facing the same issue. I am trying to implement some GraphQL library but do not know to get it to work it the unitOfWork pattern with a Business Logic Layer in between.
acookook
acookook6mo ago
I mostly read through https://medium.com/shemseddine-on-code/setup-a-graphql-api-using-asp-net-core-79f1b88f6ad8 but a I am cofused how I should user the context. Maybe via DI?
Medium
Setup a GraphQL API using ASP.NET Core
A short guide on how to setup your own GraphQL API using ASP .NET Core