Build GraphQL Microservices With Nest.js & Apollo Federation 2

preview_player
Показать описание
This video shows how we can quickly build GraphQL microservices using the Nestjs GraphQL module and Apollo Federation 2 to stitch together multiple schemas.

Timestamps:
00:00:00 Introduction
00:00:55 Create Monorepo
00:02:52 Users Service
00:09:32 Posts Service
00:14:25 Connect Gateway
00:24:54 Auth & Context

Check out my productivity app called Thrive:

Рекомендации по теме
Комментарии
Автор

Thank you Michael. I had a big project and I had to do with microservices and your tutorial helped me a lot!
God bless you man!

husinsajjadi
Автор

Очень хороший туториал по GraphQL, спасибо большое)

Betelgeuse
Автор

i started learning about microservices through your videos, now i am able to setup nestjs microservices with kubernetes and docker, can you make a video on best practices of building microservices with kubernetes ?

monawwarabdullah
Автор

Great video, well explained

Thanks for sharing

gumayuzi
Автор

Hey Michael, thanks for this video 🙂 Apollo Federation 2 is what I'm working on too. We can achieve sync communication between subgraphs. But, what about async communication? subscriptions are not supported AFAIK. The only thing I found on apollo docs is However, it's far from being a reliable solution & over complicating the scenario.
Any idea for async communication? would be wonderful if we can do it in Nestjs environment.
Cheers

muratasarslan
Автор

What should I do if I want to use MYSQL ???

enesgurbuz
Автор

Excellent! thank you very much for this!

jonhjaider
Автор

hey, can you make a project using, Nestjs, MongoDB, graphql, microservice, Nextjs

chiragprajapati
Автор

Hi Michael,

Is there a way for the subgraph to tell the supergraph to whitelist a query, I was trying to add a custom Directive (public) in the subgraph resolver on a query and wanted to check for that in the gateway and skip token auth for that query. But that is not working in Nestjs.

Also on the apollo docs, It is mentioned that Introspect and query should never be used in production. So I'll appreciate if you can guide the public on the production setup of this too. Maybe adding other features on the gateway like dynamic configuration control, rate-limiting, Auth etc.

AhmadSalmanKhan-jt
Автор

how to inject a laravel service into this gateway ?

saadmeddah
Автор

Hello Michael, or anyone who can help. My question is, can I replace the url with any public graphql api url that is accessible through graphql playground? Does the name of the service in the subgraphs array matter? Cause I keep getting this error message when I use a public graphql api url: Error: Couldn't load service definitions for "institutions" at (api url), what I'm doing wrong?

MG-wxyx
Автор

thank you for this great video, I have a question how to exclude some routes that have @isPublic decorator in the auth context?

ahmedmazendessouky
Автор

Thanks. Would like to see how nestjs plays with tRPC

g-luu
Автор

Is possible to have many-to-many relations in this video you were talking about one user having many posts, so one post belongs to one user, just imagine how it would be possible to have one post belong to many users, how GraphQL can handle it?

kamiar
Автор

Hi, how to prevent graphql gateway fail if one of our subgraphs is down? how you handle this? This behavior(actually bug) is completely against the microservices architecture concept and seems apollo doesnt care about it!!

EhsanMoallaee
Автор

can you solved the federation with subscription problem in code first?

learncodingwithnipu
Автор

Hello, any updates regarding your Udemy course? thanks!

adriandrozman
Автор

@Module({
imports: [

driver: ApolloGatewayDriver,
server: {
cors: true,

"cors:true is redline"
"Type '{ cors: true; }' is not assignable to type 'Omit<ApolloDriverConfig, "typeDefs" | "typePaths" | "include" | "resolvers" | "resolverValidationOptions" | "directiveResolvers" | "autoSchemaFile" | "transformSchema" | ... 5 more ... | "driver">'.
Object literal may only specify known properties, and 'cors' does not exist in type 'Omit<ApolloDriverConfig, "typeDefs" | "typePaths" | "include" | "resolvers" | "resolverValidationOptions" | "directiveResolvers" | "autoSchemaFile" | "transformSchema" | ... 5 more ... | "driver">'."
what could be the cause of the error

enesgurbuz
Автор

Hi Sir, I've encountered an error throw Error( ^ Error: A valid schema couldn't be composed. The following composition errors were found: Non-shareable field "User.id" is resolved from multiple subgraphs: it is resolved from subgraphs "posts" and "users" and defined as non-shareable in subgraph "users" at

RonaldoOtom-uf
visit shbcf.ru