Skip to main content


An Overview On Hot Chocolate GraphQL Implementation In Pure Code First Approach

In this article, we are going to understand Hot Chocolate GraphQL implementation in pure code first approach. GraphQL: GraphQL is an open-source data query and manipulation and language for APIs. It is a query language for your API and a server-side runtime for executing queries by using a type system you define for your data. GraphQL can be integrated into any framework like .Net, Java, NestJS, etc and it isn't tied to any specific database or storage engine and instead backed by your existing code and data. GraphQL 2 main operations: Query(fetching data) Mutation(saving or updating data) An Overview On GraphQL SDL(Schema Definition Language): In GraphQL queries or mutations made up of Schema Definition Language. This SDL syntax looks similar to a javascript object. But as a c# developer no need to learn this SDL, Hot Chocolate library makes our learning path very easy in this case. So this section is to get the basic idea of the SDL. GraphQL schema objects are created by usin

Hot Chocolate GraphQL Extending Object Types To Split Large Query And Mutation Classes

How GraphQL Extending Object Types Helps?: In GraphQL two major operations are 'Queries' and 'Mutations'.  So when we think from the code point of view all query-related logics maintain in one file and all mutation-related logics are maintained in another file. That's because GraphQL schema can't accept multiple 'Queries' and 'Mutations'. But it is a very tedious job to maintain whole business logic in just 2 files(1Query and 1 Mutation file). So to make it simple GraphQL has one technique called 'extend'. The 'extend' GraphQL schema gives us the flexibility to extend the main 'Query' or 'Mutation' which means we can have sub Queries or Mutation those derived from the parent. On execution time everything merged as a single Query or Mutation schema. Hot Chocolate GraphQL Extending Approaches: Extending Object Types can be done in 2 different approaches: Code First Pure Code First Code First: In the code first ap

NestJS API File Operations Using Azure Blob Storage

In this article, we are going to use Azure Blob Storage for all file operations like uploading, downloading, and deleting files from the NestJS API endpoint. Azure Blob Storage: Azure blob storage is Microsoft cloud storage. Blob storage can store a massive amount of file data as unstructured data. The unstructured data means not belong to any specific type, which means text or binary data. So something like images or pdf or videos to store in the cloud, then the most recommended is to use the blob store. The key component to creating azure blob storage resource: Storage Account:- A Storage account gives a unique namespace in Azure for all the data we will save. Every object that we store in Azure Storage has an address. The address is nothing but the unique name of our Storage Account name. The combination of the account name and the Azure Storage blob endpoint forms the base address for each object in our Storage account. For example, if our Storage Account is named as 'myazur

.Net5 HttpClient Retry Policy And Circuit Breaker Policy

In this article, we are going to learn about HttpClient policies like retry policy, circuit breaker policy. Retry Policy: By using HttpClientFactory it is very easy to configure the retry calls. We can configure the retry count. So if an HTTP call fails and if we configured our retry policy then the framework will automatically attempt to retry HTTP call up to the specified retry count number. Circuit Breaker Policy: The circuit breaker policy prevents our application to perform the operation that is likely to fail. An application can use both Retry Policy and Circuit Breaker Policy.  Let's understand the circuit breaker policy flow: Assume like in our application configured retry policy. Retry policy should have like count for retires and timespan between each retry. Next circuit breaker policy configured with 2 parameters like count and timespan. If the number of consecutive HTTP failed calls count matches with the circuit breaker policy count then the circuit will open means

Angular Application To Consume GraphQL Endpoint Using Apollo Angular Library

In this article, we will learn about consuming GraphQL API from angular applications using the Apollo Angular library. Overview On GraphQL API: As a front-end developer, no need to understand about in-depth nature of the GraphQL API. But it will be good to know about few key features about it for development. GraphQL API mostly has a single endpoint. So data fetching or updating will be carried out by that single endpoint. For posting data or querying data, we have to follow its own syntax. GraphQL carries two important operations: Query - fetching data Mutation - updating or saving data. Create A Sample Angular Application: Let's create a sample angular application where we are going to implement techniques to consume the GraphQL endpoint. Command To Install Angular CLI:(If not installed on your system previously) npm install -g @angular/cli Angular CLI Command To Create Angular App: ng new your_project_name Command To Run App: ng serve Install Apollo Angular Library: Apo