This tutorial demonstrates how to build a GraphQL API gateway using NestJS and Apollo Federation. It covers generating a gateway microservice, installing dependencies, configuring Docker Compose, and setting up the gateway module to stitch together various microservices into a unified endpoint.
Length 14:13
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #graphql #apollo #nestjs #microservices #api-gateway #docker #backend #federation #coding #programming
0:01 All right, so right now in our system, the only way for incoming 0:04 requests to enter our application is through our 0:08 reservations microservice, and specifically in the 0:12 reservations controller. We, of course, have all of our CRUD 0:15 methods which are exposing all of our re-reservation and CRUD 0:19 functionality. We also, of course, have our auth controller, 0:23 which is gonna be exposing basic login and the users 0:26 controller to create users, and this is all being exposed through 0:31 HTTP HP... and this is all being exposed through REST 0:34 APIs. However, I wanna show you how we can build an API 0:38 gateway using GraphQL and Apollo Federation 0:42 so that we can stitch together all of our different microservices and 0:46 expose any endpoint we want, regardless of the microservice or 0:50 the transport layer that's being used. 0:52 So we'll be able to expose endpoints in our 0:56 reservations, auth, and payments microservice using 1:00 one microservice. And to the end user, there's only gonna be one 1:04 endpoint that they need to use to be able to access all of 1:07 these different microservices, and they're all gonna be combined together 1:11 in our API gateway, which is really gonna simplify things 1:14 and make it very 1:15 easy for us to expose external-facing functionality in our 1:19 app. 1:20 So let's go ahead and set up GraphQL Apollo Federation 1:24 so that we can expose all of our microservices over a common 1:28 GraphQL microservice. So before we get started, as 1:32 usual, I'm going to keep all of the code for this 1:36 GraphQL 1:38 API gateway implementation on a separate branch called 1:41 GraphQL. So if you would like to see the completed 1:45 version 1:45 of this GraphQL implementation, please check out to the branch 1:50 GraphQL. 1:52 However, I'm gonna switch back to the main branch 1:54 and continue working. 1:55 So our first step is going to be using the Nest CLI to
The rest of the transcript is for members.
Sign in