I am writing an API to fetch data from sql db(about 120+ tables). I have generated model class files automatically. Is there any automatic way to generate Service and Query class files? Right now I am writing these IService and class files. enter image description here
Asked
Active
Viewed 29 times
-1
-
1Yes, it's documented in EF integration, and the entire idea of a Database API is simply wrong. GraphQL isn't a Database API. Exposing tables through HTTP is actually a *bad* practice that prevented the adoption of Microsoft's OData. When clients access arbitrary tables and columns, there's no way to optimize the database, add proper indexes or change its design to handle problems. – Panagiotis Kanavos Aug 21 '23 at 08:53
-
1In GraphQL the Query is a *client application's* query, not a table specification. It specifies what the *client application* wants to read from the system, and the shape the *application* expects. Autogenerating queries without knowing what the application wants will either force you to reshape the data on the client, or rewrite the query. And possibly load unwanted data as well – Panagiotis Kanavos Aug 21 '23 at 09:09
-
I understand the drawback. Could you please share the ways to generate this automatically? Atleast a skeleton framework files? – user1823133 Aug 22 '23 at 10:39