GraphQL Yoga v2 documentation (superseded by v5): NestJS is a progressive Node.js framework for building efficient, reliable and scalable server-side applications.
NestJS is a progressive Node.js framework for building efficient, reliable and
scalable server-side applications.
GraphQL Yoga provides its own NestJS GraphQL Driver that supports building standalone GraphQL APIs
and Federation GraphQL APIs (Gateway and Services).
Our Yoga Nest GraphQL Module (app.module.ts) will be defined as follows:
app.module.ts
import { YogaDriver, YogaDriverConfig } from '@graphql-yoga/nestjs'import { Module } from '@nestjs/common'import { GraphQLModule } from '@nestjs/graphql'import { RecipesModule } from './recipes/recipes.module'@Module({ imports: [ RecipesModule, GraphQLModule.forRoot<YogaDriverConfig>({ driver: YogaDriver, autoSchemaFile: 'schema.gql' }) ]})export class AppModule {}
Apollo Federation
Additionally, Yoga offers a separate driver called @graphql-yoga/nestjs-federation that supports
building Apollo Federation Gateway and Services through the YogaGatewayDriver and
YogaFederationDriver drivers.