GraphQL with ASP.NET Core (Part- VI : Persist Data - Postgres with EF Core)

Read the previous part - GraphQL with ASP.NET Core (Part- V : Fields, Arguments, Variables) This post focuses more on configuring a persistent data storage rather than discussing different aspects of GraphQL. With that being said, let's connect a Postgres database with our back-end. You may ask, why Postgres? Because everybody does SQL Server; so why not try out a different thing. In our data access layer, we will have a data store class or in another word a repository class. Since it's a good practice to code against abstraction;…

Keep reading

GraphQL with ASP.NET Core (Part- III : Dependency Injection)

Read the previous part - GraphQL with ASP.NET Core Part- II : Middleware The letter 'D' in SOLID stands for Dependency inversion principle. The principle states, A. High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. - Wikipedia Newing up instances causes strict coupling between separate code modules. To keep them decoupled from each other, we follow the 'Dependency Inversion Principle'. In this way the modules are not dependent on each other's concrete implementation rather…

Keep reading