Skip to main content


NestJS API Integration With GraphQL Using Schema First Approach

What Is GraphQL?: GraphQL is a query language for your API and a server-side runtime for executing queries by using a schema type system you defined for your data. Graphql is not tied to any specific programming language(like NestJS, Java, .NET, etc) or database or storage engine. How GraphQL Different From Rest API: GraphQL exposes a single endpoint. HTTP-POST is the only Http verb recommended by GraphQL. Client applications(consumers of GraphQL API) can give instructions to GraphQL API about the response data. Schema vs Code First Approach: Schema First Approach - GraphQL SDL (Schema definition language) is a new syntax language, which is independent of any programming language and also integrates with any programming language. But while integrating with any programming language GraphQL Schema needs to be mapped with objects or classes or interface of the specific programming language to build communication between GraphQL Schema and programming language. In Nest

.NET Core Distributed SQL Server Cache

Introduction: A caching that can be shared or consumed by the multiple apps servers can be called a Distributed Cache. Distributed Cache is an external service, which increases the performance and scalability of applications. The advantages of Distributed Cache are like: No effect on the cache server on an application crash. No need to use local memory. Consistency in serving cached data around multiple applications. In General, Distributed Cache can be achieved by using Redi's Cache, SQL Cache, Third Party Cache Libraries. Here we will learn about .NET Core Distributed SQL Server Cache. Create A .NET Core WebAPI Project: Create a sample .NET Core Web API application to test the Distributed Cache. You can use either Visual Studio 2019 or Visual Studio Code editor, here I'm using Visual Studio Code.  Click here to know basics steps to use Visual Studio Code for .NET Core applications .  SQL Table For Cache: To store the cache data we need a table. So .NET

NestJS Multiple MongoDB Databases Accessing Sample Code

Introduction: Most of the case's applications are going to communicate with more than one database. Here I'm going to walk through with sample NestJS application which communicates with multiple MongoDB's.  Click here to know more about NestJS API CRUD using MongoDB . MongoDB Atlas: MongoDB Atlas is a cloud database. It has all the options of creating a MongoDB instance like for Free MongoDB Instance(for learning), Paid MongoDB Instance(for production). To illustrate multiple MongoDB connections for sample application here I'm going to use this Cloud MongoDB Atlas. It is fairly minimal steps involved for created a Cloud MongoDB instance. Note: It is not mandatory to use the cloud based MongoDb database. You can use either locally installed instances like Mongo Shell, MongoDb Compass. Create Sample NestJS Application: NestJS provides CLI which helps to create a boilerplate templated application to getting started NestJS CLI command: np

Blazor Server Form Validation

Introduction: Blazor Server Form validation can be achieved by using the 'System.ComponentModel.DataAnnotations' . Blazor Sever is a component-based application, and it provides some default key components for validation like 'EditForm' , 'DataAnnotationsValidator' , 'ValidationSummary' , etc. Overview On Validation Process: Blazor Server opts for two kinds of validation like: Validation Type 1 - Field Validation, like when the user focuses out of a particular field of a form(eg like user types something and then clicks cursor out of text box), then 'DataAnnotationValidator' component report the validation error message for the particular field by sending the field data to the server for validation. Validation Type 2 - On Submitting the form, the form gets validated by the Model level where the 'DataAnnotationValidator' helps to show error messages report from server to the respective fields on UI. Create Blazor Se