Earlier in this series, we will created our first GraphQL Server. If you had noticed we defined our data types as plain C# classes. This was a simple example of Annotation based approach, though actually we did not use any annotation. However, things can change when one needs to expose another query resolver. Annotation Based … Continue reading GraphQL Day 002 : Type Definition basics
Author: Anu Viswan
GraphQL Day 001: Creating your first GraphQL server with HotChocolate
In the earlier part of the series, we familiarized ourselves with the different building blocks of GraphQL. We also understood the need of GraphQL and how it fares compared to REST endpoints. In this post, we will create our first GraphQL server. For sake of this example, we will be using the HotChocolate library for building our … Continue reading GraphQL Day 001: Creating your first GraphQL server with HotChocolate
GraphQL Day 000 : Introduction to Building Blocks
In this series of articles, we will walk through GraphQL and understand its importance in modern applications. Introduced by Facebook, and later moved to newly established GraphQL foundation, GraphQL has become integral part of modern applications. Day 00 : Introduction to the building blocks Day 01: Creating your first GraphQL server with HotChocolate Day 02 : … Continue reading GraphQL Day 000 : Introduction to Building Blocks
Running MongoExpress in Docker : Solving the connection issue
In this post, we will attempt to run MongoDb and Mongo Expres on docker. That doesn't look challenging, then why a post dedicated to the same ? This is because of one common mistake that developer tends to do (oh yes, I made the mistake) and end up wondering why it doesn't work as desired. Let us write our … Continue reading Running MongoExpress in Docker : Solving the connection issue
Axios, Typescript and Vue 3
In this post, we will aim to create a clean architecture for accessing a rest endpoint, using Axios with Typescript and Vue 3. The key focus here would be to how structure your typescript classes to increase code reuse and isolating the actual axios calls. The approach I follow now is based on building an … Continue reading Axios, Typescript and Vue 3
Child Component Validation using Vuelidate
In this post, we will attempt to validate a form, which contains Child Components while submitting. This is a common scenario that one might face in real life. In this example, we will use the Vuelidate Library for validation. Let us first define the Parent Component. <template> <form @submit.prevent="onManualSubmit"> <label for="name">Name</label> <input id="name" type="text" v-model="name" /> <label for="caption">Caption</label> <input … Continue reading Child Component Validation using Vuelidate
Conditional Serialization in Protobuf
In this blog post, we will discuss how to conditionally serialize a property when using Protobuf Serialization. We are using the Protobuf-net library by Marc Gravell. I will attempt to use the same example class/scenario which I had previously used for Conditional Serialization in Json since it bears a lot of similarity. [ProtoContract] public class User { [ProtoMember(1)] public … Continue reading Conditional Serialization in Protobuf
Nginx and Load Balancing
In this article we will look into setting up a load balancer using Nginx. Nginx is an open source web server and reverse proxy that is quite frequently used for load balancing. We will also use simple-web, which is a simple web server that outputs IP address of source and destination, which makes it easier for … Continue reading Nginx and Load Balancing
Hidden gems in List Pattern
In this blog post, we will explore few hidden gems in list patterns , which was introduced with C# 11. List Pattern allows us to check patterns in arrays or list. Assign Variable You can assign variables using pattern, provided the pattern matches. For example, var arr = new [] {1,2,3,4,5}; if(arr is [_,2,var third,..] match) { … Continue reading Hidden gems in List Pattern
Install Extensions in Postgres Docker container
Recently I wanted use the Fluent migrator for seeding my postgres database, which was running as a docker container. I basically had a table User, which had a primary key of type UUID that needs to be auto-generated. My migration code looked as follows. Create.Table(User.TABLE_NAME) .WithColumn("id").AsGuid().NotNullable().WithDefaultValue(SystemMethods.NewGuid).PrimaryKey() .WithColumn("username").AsString().NotNullable() .WithColumn("password").AsString().NotNullable(); The above code would essentially turn out as the following postgres sql. … Continue reading Install Extensions in Postgres Docker container