{"id":1684,"date":"2023-04-06T09:19:13","date_gmt":"2023-04-06T09:19:13","guid":{"rendered":"https:\/\/www.workfall.com\/learning\/blog\/?p=1684"},"modified":"2025-09-19T03:53:52","modified_gmt":"2025-09-19T03:53:52","slug":"building-real-time-apps-with-nestjs-and-graphql-subscriptions","status":"publish","type":"post","link":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/","title":{"rendered":"Building Real-Time Apps with NestJS and GraphQL Subscriptions"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/lfWHPhCC6_WtjJodLyvqSTqO9dxNWLROmrQ7UObCjYtMbbYF9PYmAa-GT83hufTY3tYfdcpdfsUkvmxejk4TQ0zJ7tVaCVI9zxrAOwyZvjpZgRXif1Ti6LJLWZ5FX3f9ThS26-KP9RpE59uB_Qka-OA\" alt=\"Building Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">Real-time applications are important in several instances. Especially in a scenario whereby immediate feedback is important such as messaging apps and IoT apps. Let\u2019s imagine a case in IoT whereby a smoke detector needs to relay information to water sprinklers in a burning building. This information has to be in real-time to save the situation before it worsens.<\/p>\n\n\n\n<p>In this blog we will cover:<\/p>\n\n\n\n<ul><li>NestJS<\/li><li>GraphQL Subscriptions<\/li><li>Hands-on<\/li><li>Conclusion<\/li><\/ul>\n\n\n\n<h2>NestJS<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">NestJS is a well-known open-source web framework for developing scalable and efficient Node.js applications. It is intended to provide a modular and easy-to-maintain architecture, making it an excellent alternative for designing complicated applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\">NestJS<\/a> is built on top of popular frameworks such as Express and TypeScript, and it includes a lot of features out of the box such as dependency injection, testing utilities, and support for several database types.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Its architecture is highly influenced by Angular, making it a familiar alternative for developers who are already familiar with the principles and design patterns of Angular.<\/p>\n\n\n\n<h2>GraphQL Subscriptions<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/vm3kCoearXeRJGxR5NuEFI8pmx7C3T-rBkuv170bXMLgNZdR68fN4DZ5sdgl6_gFnZcA9xoOlFtd4DrUbY7fzCiDifJhxYA04qzaBn_3MZaoybZx06YcVZUhP4HTsai5mAGaZpm1rWPqOzikOTnHRuc\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">GraphQL Subscriptions is a GraphQL API feature that allows for real-time communication between the client and the server. GraphQL Subscriptions eliminate the need for excessive polling and reduce latency by allowing the server to deliver updates to the client as soon as they become available, removing the need for needless polling and decreasing latency.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">Clients can subscribe to specific data events on the server using GraphQL Subscriptions, such as the creation of a new resource or the updating of an existing one. Once subscribed, the server will deliver any relevant updates to the client in real-time. This is especially beneficial for applications that demand real-time updates, such as chat apps, social media feeds, or dashboards.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">GraphQL Subscriptions are specified by a separate schema that details the many sorts of events that clients can subscribe to, as well as the data that is returned when those events occur. The server sends updates to registered clients using WebSocket connections, and clients can unsubscribe from events when they are no longer required.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">From the name itself, a subscription is meant for a subscriber. In this case, it is a client of any sort &#8211; a mobile app, a web app &#8211; who has opted in to receive real-time updates based on events that are fired on the server.<\/p>\n\n\n\n<h2>Hands-On<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/5fUcrnzOEl5JgNWZ7r4y_cJBp1Wad7UpuDFyC2Qiyek7pw0u47oa1ZpOU4NCc-iLWFpyU8KNDTleSeXq9rc2TWLJnbxh-NFkM5UKzCNfwetKtNXdpJIqTjqThQh1rA4vX6GXI6h2mYHy2VOFad9FVew\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p>The repository for the code used in this blog is at <a href=\"https:\/\/github.com\/workfall\/workfall-nest-graphql\">https:\/\/github.com\/workfall\/workfall-nest-graphql<\/a>&nbsp;<\/p>\n\n\n\n<h3>Pre-requisites<\/h3>\n\n\n\n<p class=\"has-text-align-justify\">First of all, you have to ensure that MongoDB is installed on your machine. Follow this link <a href=\"https:\/\/www.mongodb.com\/docs\/manual\/installation\/\">https:\/\/www.mongodb.com\/docs\/manual\/installation\/<\/a> to install your OS-compliant MongoDB. Make certain that the community edition is installed.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">You should have NestJS cli installed and you can generate a new app using the command <strong>nest new &lt;app_name&gt;<\/strong>. After that, we can start by configuring MongoDB and GraphQL.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">In your project folder, open the terminal and install the following <strong>npm i @nestjs\/mongoose mongoose<\/strong> and <strong>npm i @nestjs\/graphql @nestjs\/apollo @apollo\/server graphql<\/strong>.<\/p>\n\n\n\n<h3>Folder Structure<\/h3>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" src=\"https:\/\/lh3.googleusercontent.com\/9_gXMkbNGGmdS9z7RYdDrlsINemKzfyogNfRKRAGYUTlUR6g-bEiHXRmympAltO8WtgM4CN1nZxk8blWMxUttpDJJfC86O_ymjC0jLXlrtFOvGBvdGw1t9fEv0TfdunjwGwBOnT2E2ARigxwY_2-7QY\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\" width=\"431\" height=\"701\"\/><\/figure>\n\n\n\n<h3>Configurations<\/h3>\n\n\n\n<p>Let us start by configuring MongoDB and GraphQL in the root module<\/p>\n\n\n\n<p><strong>app.module.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/mszO52URfBarIr8dF3bIN9Rn8KXoaofzS7Nv_PiNiIMZG5fIDwHy62PdGKk2Vt8e6n_16ker2U7eF9SUXqO8GsEdg2OilKcyu--U2b6dcHyz_Rz7HmvLEHj6HEaV50aACX9h2QcLpPsZdRRg_lTu8MI\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will notice an error because GraphQL does not have any resolvers, so you have to create at least one resolver and add it to the providers.<\/p>\n\n\n\n<p class=\"has-text-align-justify\"><strong>resolvers\/user.resolver.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/yg_K06cV8__0XYEmRHLaUhrsudpwqtEjG3vPJqcwfhtHDt5tTQuj4Zj1achBlQm8hMFCLRrz1SX1bcHT1rsa1vUsRXN-Xff5rC1cdKsZEz2UzUGlZVfEbraFTSiswRUaFOXsp7gmcYrQGgYTsrI-KXI\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p><strong>models\/user.model.ts:<\/strong><\/p>\n\n\n\n<p>Note that @InputType allows us to define user input parameters for the GraphQL schema.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/5zzg2b4Ru1tYW2WjP_wIPjNSQwvcoCi7rpDnvn9zI1dG7u4-tAMm5XQYAt9qwJ4EQjqnMGCzc7cr957mXoEh-OB1SoS29yE7DlhoNqFVGV56G94y4wjkrm62zBcX5hybAZVZMBP9EIMQCyPHAVNSthM\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p><strong>main.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/pomprPCd-S961IiDLDLlOJYEeuvqIQR8JiIGkVFTnct9zy2wDMrP23BV1RUlh6PkiKxiB4CxAasuZ1CEJiJzFZRN_afS3Ntplr7ehBmV0h5YC2hmu4KSz5JQbnxOrNKSdojxzIQz4j9Chx2gQE5RD4g\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will notice that we have done away with all the controllers because we are not going to use any other endpoints apart from <strong>\/graphql<\/strong>. If you run the app, you should be able to see the GraphQL playground as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/Ho5pYudK4mc7aI8ZN5I4OeSojJTDt__-uAXG-g3lpf3-0boUmekLnQdVAT2XPACnGYoNEJaPVVv0zpyrMq7EjqJCAmpOov1wLWCu75N5XCBVRAPOcyULOaTrIwSCAY41hOsfyH0MzvgZ5MALmvy6tGM\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<h3>Code<\/h3>\n\n\n\n<p class=\"has-text-align-justify\">We can write our first query to see if it works. Always used named operations to make your development testing easier.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/mc-lzCVnE6vS4OCK-nMUlke7HhkSKPHWDjJ8gav1vzC6ICOvYfknNLvSwg27VfVe-EuPBzay6yTueT-1cKNPdw4pMDUv6lOcEi-VWTnxVvUa6sAQCiHJybLw9oMiRBSmlKj2kEcw6Um6QIqaOVHZ3sw\" alt=\"\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">You will notice that GraphQL is smart enough to know which fields exist in your schema. You should also note that it generates a <strong>schema.gql<\/strong> file in the root of your project and this file should not be manually changed. Any time GraphQL detects a new schema or operation in the resolver, it registers the schema and any other operations such as mutations, queries, and subscriptions.<\/p>\n\n\n\n<p><strong>schema.gql:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/kYjfw_C6WUcUvWSJKCnb_estRqeTmamFDZLG7eZGf8TFu_ur_Cq-tPljK9nfY1EtreiAALW0xPIkScD02MGkUzcCWm6-fphYLg2Ol22PFURTv99gofJQXiodhb9wKle60CUWGCFFuX_5Lehak8NcIns\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>collections\/user.schema.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/L_TzNPONJ8UmxrbsSnHDYWBQ4NZSsCMRTG7Z0ZOQeM_FrHf_8Ndcwo0ZCHBteOoEB4aMnZAwXaT71GIQpia_DQ3wX_gymJicAq12C20-n4RruBjpsdPRMBsnszumNfqHqMTiy6BFmhIhoZqMrrKjxD8\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>database\/database.module.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/448FSHALLmHD9tmofKcZe-9B5cmEz_Lx3zS1uGphxK_2Lt3FWnaUoyEiREdTGiKFHV7Xcec3nv8mO4cwZvlBD-gqtBxgJ9aPJx5pJJqe8p0VSVriw7xB1QVKtY08fwgNq_8TSUlV_lE4FJoqY-ttmvM\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>app.module.ts:<\/strong><\/p>\n\n\n\n<p>It is most advisable to change the Mongoose root module config to use <strong>forRootAsync<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh6.googleusercontent.com\/AWjicj9G7JmQyyZlU5lRAw5jomvVf6tmFTyjt2NYMX-ftojSPdMYNXqttE-xB-tG_WJoEgy3Tgk_kz9xUd7gPDCzSR7NGVbQSCifUP6JVhrQ3QYX6HnKAkqJqao1colY0MUPqlBEjQL43XBOJJ2w_TM\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>app.service.ts<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/Ep4KVkQUZCqWP3PhUdWLlVbeCAYq-w4e9ogZ53BY5Bqnjsxgc6u4l0WhILtRs6_6i8ebCiY2CP5rlrW94zt0SttWReq7p3-TNOCIEbX6GmjMxmmLLzdABmYTBEgNMJ5i7q0Q4Xeie0I75IK5xzne75g\" alt=\"\"\/><\/figure>\n\n\n\n<p><strong>user.resolver.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh4.googleusercontent.com\/OWlZvDq1xltoeFg49_0OpnAle3RZW40jrIvHTdpENF2a52q142NaJOhLRnAoRI4T3KFkqSqfxtPQC46U84cEkM-OE6YIMrLwJ1iihi8slpnEepK5Z4udZ-6VbYzy_rUVm0KTE29mcmCqX0y1qQzbtT8\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p>You should be able to perform a createUser Mutation and a getUser query as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/joqIDrb5YZqyx357u3eg4jimxM-V27brKczhfCcctri6si4teRwIGA4b0ms-AnDnHzUsHq1eKk3lz3Odg68ORU0mLsjUl5jABQajRLw6NpEEbDA9i7FeU8i_Gg6puu78D0rMCx86jfQDplEe372Nw8o\" alt=\"\"\/><\/figure>\n\n\n\n<h3>Subscriptions<\/h3>\n\n\n\n<p class=\"has-text-align-justify\">Now we need to create a real-time update each time a new user is created. We will set up a GraphQL subscription. First, we need to do a configuration to the GraphQL module to use subscriptions and also change the transport layer to web sockets instead of HTTP.<\/p>\n\n\n\n<p><strong>app.module.ts:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/yL0U8oN_QEoArpiq5p33q4nLIEDtCoiWyxrEemK5moyHy0MoveTVs3Y_bag-A0WfWpXcn5SPWEveEiICYSv6fbJS7jWQZ-9I3elQG3QHBYvYcqhAk2Nq3MeUI0NL2spr2V0G5rtHkt9nKfJMDC8KWSQ\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p><em>Note: Remember to install graphql-subscriptions, subscriptions-transport-ws and graphql-ws packages.<\/em><\/p>\n\n\n\n<p><strong>resolvers\/user.resolver.ts<\/strong>:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/fEIOoJEgTKygKAJyFa6x7YaB5i4Ro5b_qNC-l_Vbr5VqPJyM0EpGMugjUdM7hjLpLuImZYWOPsu9nZYgTRCMV--lFhmfz1GJfK61zgbgqob_sGtU8zDEoUm4__Nxq-Ilu5fR2WEVsdgmZNyUkXpN1Vw\" alt=\"Real-Time Apps with NestJS and GraphQL Subscriptions\"\/><\/figure>\n\n\n\n<p class=\"has-text-align-justify\">In the above code, we begin by initializing a publisher at the top level. Then we create a subscription in the resolvers. In the createUser mutation, we publish the newUser event with the created user so that all subscribers receive the latest data.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">The split screen below shows a publisher and a listening subscriber, once we create a new user, the subscriber receives the new data immediately.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/rDnZ99oLUiXlTX6WxFUjaV1DI3RyF9EchvdsWByAaPlX4qh2Msod4L-LscHwR-DbRGD9w1i6z1J0Rw0HBohS-nkBGx2i7zuqzw-nlRKrgIR0XrQBjrRCvZjIfSb4XCF5ddP4TvTUXVykpauKl_86Wos\" alt=\"\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh3.googleusercontent.com\/_vSWsOzOoaWdzyq1H4R4stlLoEQpGoW_lEA5QmQzmrlZKab0mHDoFGG1CT1kdw6L4bmoah5wheUvzQ9YfbjH6dETAez8g87iGarMynrE7FiwimYsLplSTkb_ekLN0lnFE0UeJvC3A5TB232W6CU05_I\" alt=\"\"\/><\/figure>\n\n\n\n<h2>Conclusion<\/h2>\n\n\n\n<p class=\"has-text-align-justify\">In this blog, we learned how we can create a real-time backend application using GraphQL subscriptions. With the use of real-time protocols like web sockets, we can create powerful applications such as chat applications, IoT applications, and data streaming applications.<\/p>\n\n\n\n<p class=\"has-text-align-justify\">GraphQL is a powerful tool and it makes server-side evolution less painful and more fault tolerant compared to the REST architecture. We will come up with more such use cases in our upcoming blogs.<\/p>\n\n\n\n<p><strong>Meanwhile\u2026<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-justify\">If you are a NestJS &amp; GraphQL Enthusiast and want to explore more about the above topics, here are a few of our blogs for your reference:<\/p>\n\n\n\n<ul><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/create-a-no-code-graphql-server-using-hasura-and-postgresql\/\">Create a No-code GraphQL Server Using Hasura and PostgreSQL<\/a><\/li><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-upload-large-files-1gb-and-beyond-to-aws-s3-using-nestjs-backend-and-reactjs-frontend\/\">How to upload large files (1GB and beyond) to AWS S3 using NestJS (backend) and ReactJS (frontend)?<\/a><\/li><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/\">How to Architect NestJS Microservices with AWS Elastic Beanstalk?<\/a><\/li><li><a href=\"https:\/\/www.workfall.com\/learning\/blog\/how-to-deploy-nestjs-microservices\/\">How to Deploy NestJS Microservices to AWS Elastic Beanstalk?<\/a><\/li><\/ul>\n\n\n\n<p>Stay tuned to get all the updates about our upcoming blogs on the cloud and the latest technologies.<\/p>\n\n\n\n<p><strong>Keep Exploring -&gt; Keep Learning -&gt; Keep Mastering&nbsp;<\/strong><\/p>\n\n\n\n<p>At <a href=\"https:\/\/www.workfall.com\/\">Workfall<\/a>, we strive to provide the best tech and pay opportunities to kickass coders around the world. If you\u2019re looking to work with global clients, build cutting-edge products, and make big bucks doing so, give it a shot at <a href=\"https:\/\/www.workfall.com\/partner\/\">workfall.com\/partner<\/a> today!<br><\/p>\n\n\n<style type=\"text\/css\"><\/style><section id='' \n                class='helpie-faq accordions faq-toggle open-first groupSettings-499__enabled' \n                data-collection='' \n                data-pagination='0' \n                data-search='0' \n                data-pagination-enabled='0'\n                role='region'\n                aria-label='FAQ Section'\n                aria-live='polite'><h3 class=\"collection-title\">Frequently Asked Questions:<\/h3><article class=\"accordion \"><div class='helpie-faq-row'><div class='helpie-faq-col helpie-faq-col-12' ><ul><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-2795\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-2795\"\r\n                data-id=\"post-2795\" \r\n                data-item=\"hfaq-post-2795\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q: Why choose NestJS for real-time GraphQL subscriptions?<\/div><\/div><div id=\"accordion-content-post-2795\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-2795\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\"><strong>A:<\/strong> NestJS provides a modular architecture out of the box, TypeScript support, dependency injection, and built-in support for GraphQL via packages like <\/span><span style=\"font-weight: 400\">@nestjs\/graphql<\/span><span style=\"font-weight: 400\">. It&#8217;s well-suited for scalable server applications needing structured code.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-2796\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-2796\"\r\n                data-id=\"post-2796\" \r\n                data-item=\"hfaq-post-2796\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q: What setup is needed to enable GraphQL subscriptions in a NestJS app?<\/div><\/div><div id=\"accordion-content-post-2796\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-2796\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\"><strong>A:<\/strong> You need to install the GraphQL + subscription libraries (<\/span><span style=\"font-weight: 400\">@nestjs\/graphql<\/span><span style=\"font-weight: 400\">, <\/span><span style=\"font-weight: 400\">@nestjs\/apollo<\/span><span style=\"font-weight: 400\">, plus <\/span><span style=\"font-weight: 400\">subscriptions-transport-ws<\/span><span style=\"font-weight: 400\"> or <\/span><span style=\"font-weight: 400\">graphql-ws<\/span><span style=\"font-weight: 400\">), configure your GraphQL module to enable WebSocket transport, define resolvers for subscription events in addition to queries\/mutations, and use a PubSub mechanism to publish events.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-2797\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-2797\"\r\n                data-id=\"post-2797\" \r\n                data-item=\"hfaq-post-2797\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q: What database is used in the example, and why?<\/div><\/div><div id=\"accordion-content-post-2797\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-2797\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\"><strong>A:<\/strong> The tutorial uses <\/span><b>MongoDB<\/b><span style=\"font-weight: 400\"> (via Mongoose) as the database to store user data. It\u2019s chosen likely for simplicity and because NestJS integrates well with it.<\/span><\/p>\n<\/div><\/li><li class=\"accordion__item \"><div class=\"accordion__header \" \r\n                id=\"accordion-header-post-2798\"\r\n                role=\"button\"\r\n                aria-expanded=\"false\"\r\n                aria-controls=\"accordion-content-post-2798\"\r\n                data-id=\"post-2798\" \r\n                data-item=\"hfaq-post-2798\" \r\n                style=\"background:transparent;\" \r\n                data-tags=\"\"\r\n                tabindex=\"0\"><div class=\"accordion__title\">Q: How does the subscription get triggered in the example?<\/div><\/div><div id=\"accordion-content-post-2798\" \r\n                class=\"accordion__body\" \r\n                role=\"region\"\r\n                aria-labelledby=\"accordion-header-post-2798\"\r\n                style=\"background:transparent;\"><p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span><span style=\"font-weight: 400\"><strong>\u00a0A:<\/strong> In the example, a <\/span><span style=\"font-weight: 400\">createUser<\/span><span style=\"font-weight: 400\"> mutation is implemented. Whenever this mutation is called, the code publishes a \u201cnewUser\u201d event via the PubSub, so any client subscribed to that event receives the new user data in real time.<\/span><span style=\"font-weight: 400\"><br \/>\n<\/span><\/p>\n<\/div><\/li><\/ul><\/div><\/div><\/article><\/section>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading Time: <\/span> <span class=\"rt-time\">6<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span> Real-time applications are important in several instances. Especially in a scenario whereby immediate feedback is important such as messaging apps and IoT apps. Let\u2019s imagine a case in IoT whereby a smoke detector needs to relay information to water sprinklers in a burning building. This information has to be in real-time to save the situation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1685,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[288],"tags":[164,37,357,424,425,6],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog<\/title>\n<meta name=\"description\" content=\"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog\" \/>\n<meta property=\"og:description\" content=\"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/\" \/>\n<meta property=\"og:site_name\" content=\"The Workfall Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/workfall\" \/>\n<meta property=\"article:published_time\" content=\"2023-04-06T09:19:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-19T03:53:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@workfall\" \/>\n<meta name=\"twitter:site\" content=\"@workfall\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Workfall\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\",\"name\":\"Workfall - Hire #Kickass Coders On Demand\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/\",\"sameAs\":[\"https:\/\/www.instagram.com\/workfall\/\",\"https:\/\/www.linkedin.com\/company\/workfall\/\",\"https:\/\/facebook.com\/workfall\",\"https:\/\/twitter.com\/workfall\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"contentUrl\":\"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400\",\"width\":400,\"height\":400,\"caption\":\"Workfall - Hire #Kickass Coders On Demand\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#website\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/\",\"name\":\"The Workfall Blog\",\"description\":\"#Tech #Remote #Jobs\",\"publisher\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/learning.workfall.com\/learning\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png\",\"width\":1200,\"height\":628,\"caption\":\"Building Real-Time Apps with NestJS and GraphQL Subscriptions\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/\",\"name\":\"Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage\"},\"datePublished\":\"2023-04-06T09:19:13+00:00\",\"dateModified\":\"2025-09-19T03:53:52+00:00\",\"description\":\"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!\",\"breadcrumb\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/learning.workfall.com\/learning\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Building Real-Time Apps with NestJS and GraphQL Subscriptions\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage\"},\"author\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\"},\"headline\":\"Building Real-Time Apps with NestJS and GraphQL Subscriptions\",\"datePublished\":\"2023-04-06T09:19:13+00:00\",\"dateModified\":\"2025-09-19T03:53:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage\"},\"wordCount\":1110,\"publisher\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png\",\"keywords\":[\"graphql\",\"IoT\",\"nestjs\",\"Real-time\",\"realtimeapps\",\"workfall\"],\"articleSection\":[\"Backend Development\"],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a\",\"name\":\"Workfall\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"contentUrl\":\"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png\",\"caption\":\"Workfall\"},\"sameAs\":[\"https:\/\/www.workfall.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog","description":"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/","og_locale":"en_US","og_type":"article","og_title":"Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog","og_description":"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!","og_url":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/","og_site_name":"The Workfall Blog","article_publisher":"https:\/\/facebook.com\/workfall","article_published_time":"2023-04-06T09:19:13+00:00","article_modified_time":"2025-09-19T03:53:52+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@workfall","twitter_site":"@workfall","twitter_misc":{"Written by":"Workfall","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization","name":"Workfall - Hire #Kickass Coders On Demand","url":"https:\/\/learning.workfall.com\/learning\/blog\/","sameAs":["https:\/\/www.instagram.com\/workfall\/","https:\/\/www.linkedin.com\/company\/workfall\/","https:\/\/facebook.com\/workfall","https:\/\/twitter.com\/workfall"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","contentUrl":"https:\/\/i1.wp.com\/18.141.20.153\/learning\/blog\/wp-content\/uploads\/2021\/10\/cropped-WF_logo.png?fit=400%2C400","width":400,"height":400,"caption":"Workfall - Hire #Kickass Coders On Demand"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/logo\/image\/"}},{"@type":"WebSite","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#website","url":"https:\/\/learning.workfall.com\/learning\/blog\/","name":"The Workfall Blog","description":"#Tech #Remote #Jobs","publisher":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/learning.workfall.com\/learning\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png","width":1200,"height":628,"caption":"Building Real-Time Apps with NestJS and GraphQL Subscriptions"},{"@type":"WebPage","@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage","url":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/","name":"Building Real-Time Apps with NestJS and GraphQL Subscriptions - The Workfall Blog","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage"},"datePublished":"2023-04-06T09:19:13+00:00","dateModified":"2025-09-19T03:53:52+00:00","description":"Ready to take your app to the next level? Learn how to build real-time apps with NestJS and GraphQL Subscriptions!","breadcrumb":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/learning.workfall.com\/learning\/blog\/"},{"@type":"ListItem","position":2,"name":"Building Real-Time Apps with NestJS and GraphQL Subscriptions"}]},{"@type":"Article","@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#article","isPartOf":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage"},"author":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a"},"headline":"Building Real-Time Apps with NestJS and GraphQL Subscriptions","datePublished":"2023-04-06T09:19:13+00:00","dateModified":"2025-09-19T03:53:52+00:00","mainEntityOfPage":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#webpage"},"wordCount":1110,"publisher":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/#organization"},"image":{"@id":"https:\/\/learning.workfall.com\/learning\/blog\/building-real-time-apps-with-nestjs-and-graphql-subscriptions\/#primaryimage"},"thumbnailUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png","keywords":["graphql","IoT","nestjs","Real-time","realtimeapps","workfall"],"articleSection":["Backend Development"],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/cab8236044692bc5b27606b13167794a","name":"Workfall","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/learning.workfall.com\/learning\/blog\/#\/schema\/person\/image\/","url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","contentUrl":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/09\/avatar_user_1_1693914404-96x96.png","caption":"Workfall"},"sameAs":["https:\/\/www.workfall.com"]}]}},"jetpack_featured_media_url":"https:\/\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2-1.png","jetpack-related-posts":[{"id":1689,"url":"https:\/\/learning.workfall.com\/learning\/blog\/supercharge-your-react-app-with-real-time-graphql-subscriptions-apollo-client\/","url_meta":{"origin":1684,"position":0},"title":"Supercharge Your React App with Real-Time GraphQL Subscriptions & Apollo Client","date":"April 18, 2023","format":false,"excerpt":"Modern applications are getting more real-time. Notification updates, chat messaging applications, and financial market updates are all examples of real-time updates in online apps. With a feature called subscriptions, GraphQL makes it simple to create apps with low latency, and real-time updates. In this blog, we will discuss: PollingWebSocketsGraphQL SubscriptionsApollo\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Supercharge Your React App with Real-Time GraphQL Subscriptions & Apollo Client","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/04\/Cover-Images_Part2.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1513,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-upload-large-files-1gb-and-beyond-to-aws-s3-using-nestjs-backend-and-reactjs-frontend\/","url_meta":{"origin":1684,"position":1},"title":"How to upload large files (1GB and beyond) to AWS S3 using NestJS (backend) and ReactJS (frontend)?","date":"November 15, 2022","format":false,"excerpt":"When dealing with file uploads, you must be aware that files are uploaded in buffers stored in memory and if the file is larger than the allocated memory in your VM, it may run out of memory and the application might crash. For example, if your allocated memory is 2GB,\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to upload large files (1GB and beyond) to AWS S3 using NestJS (backend) and ReactJS (frontend)?","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/11\/Cover-Images_Part2-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":523,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-create-an-api-endpoint-to-provision-a-dynamodb-table-using-aws-appsync-part-1\/","url_meta":{"origin":1684,"position":2},"title":"How to create an API endpoint to provision a DynamoDB table using AWS AppSync? (Part 1)","date":"November 10, 2021","format":false,"excerpt":"AppSync is an AWS-managed GraphQL layer that is built on the benefits of GraphQL and adds a few more cool features to its web and mobile SDKs. AppSync is the best of GraphQL with less complexity than before, which works out great for Serverless applications. You can refer to our\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"AWS AppSync - Integration with React Application","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2021\/11\/CoverImages_1200x628px-1-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1066,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-architect-nestjs-microservices-with-aws-elastic-beanstalk\/","url_meta":{"origin":1684,"position":3},"title":"Architect NestJS Microservices with AWS Elastic Beanstalk","date":"July 19, 2022","format":false,"excerpt":"In the AWS Cloud journey, we come across Elastic Beanstalk to be better than other services in managing the infrastructure environments effectively. On the other hand, NestJS is popular in creating efficient and scalable server-side applications, and is relatively a new option for the backend framework - it is lightweight,\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"Architect NestJS Microservices with AWS Elastic Beanstalk","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS-Microservices-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1680,"url":"https:\/\/learning.workfall.com\/learning\/blog\/create-a-no-code-graphql-server-using-hasura-and-postgresql\/","url_meta":{"origin":1684,"position":4},"title":"Create a No-code GraphQL Server Using Hasura and PostgreSQL","date":"March 28, 2023","format":false,"excerpt":"To handle CRUD, authorization, and business logic, backend developers frequently need to write several lines of code. All of this code must be tested, debugged, and maintained for the duration of the project. This consumes a significant amount of time that developers could be used to create new features. This\u2026","rel":"","context":"In &quot;Backend Development&quot;","img":{"alt_text":"No-code GraphQL Server Using Hasura and PostgreSQL","src":"https:\/\/i0.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2023\/03\/Cover-Images_Part2-1-3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1083,"url":"https:\/\/learning.workfall.com\/learning\/blog\/how-to-deploy-nestjs-microservices\/","url_meta":{"origin":1684,"position":5},"title":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","date":"July 26, 2022","format":false,"excerpt":"AWS Elastic Beanstalk is an AWS service on which you can deploy your application and it offers orchestration for various AWS services such as EC2, and S3 out of the box through auto-scaling, load-balancing, and capacity provisioning. All you have to do is upload your code and AWS Elastic Beanstalk\u2026","rel":"","context":"In &quot;AWS Cloud Computing&quot;","img":{"alt_text":"How to Deploy NestJS Microservices to AWS Elastic Beanstalk?","src":"https:\/\/i1.wp.com\/learning.workfall.com\/learning\/blog\/wp-content\/uploads\/2022\/07\/NestJS.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1684"}],"collection":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/comments?post=1684"}],"version-history":[{"count":4,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1684\/revisions"}],"predecessor-version":[{"id":2800,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/posts\/1684\/revisions\/2800"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media\/1685"}],"wp:attachment":[{"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/media?parent=1684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/categories?post=1684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learning.workfall.com\/learning\/blog\/wp-json\/wp\/v2\/tags?post=1684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}