Skip to main content

Posts

Showing posts with the label Web API

Part-2 An Overview On GraphQL Implementation In .Net Application Using Hot Chocolate Library

Part-1  shown startup steps like initial configuration of Hot Chocolate GraphQL library into the .Net5 Web API application. This is a continuation part here we are going to understand a few concepts like fetching data from the database, GraphQL mutations, different GraphL queries, etc. Configure EntityFrameworkCore Database Context: Now we need to integrate our database into our GraphQL endpoint by creating an entity framework core database context. Package Manager Command: Install-Package Microsoft.EntityFrameworkCore -Version 5.0.1 .Net CLI Command: dotnet add package Micorsoft.EntityFrameworkCore -Version 5.0.1 Package Manager Command: Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 5.0.1 .Net CLI Command: dotnet add package Microsoft.EntityFrameworkCore.SqlServer -Version 5.0.1 Now add your connection string into the app settings file. appsettings.Development.json: "ConnectionStrings":{ "MyWorldDbConnection":"Your_database_Connectio

Part-1 An Overview On GraphQL Implementation In .Net Application Using Hot Chocolate Library

In this article, we are going to understand the implementation steps of GraphQL in .Net5 application using Hot Chocolate Library. GraphQL: GraphQL is an open-source data query and manipulation 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, NetsJS, etc and it isn't tied to any specific database or storage engine and instead backed by your existing code and data. GraphQL caries two important operations: Query - fetching data Mutation - save or update. Hot Chocolate GraphQL: Hot Chocolate is an open-source GraphQL server that is compliant with the newest GraphQL latest specs. It is the wrapper library of the original .Net GraphQL library. Hot Chocolate takes the complexity away from building a fully-fledged GraphQL server. An Overview On GrphQL SDL(Schema Definition Language): A syntax to data query and manipulation