Integration with NestJS
Hive Gateway Driver for Nest (Nest JS) is a Node.js framework for building server-side applications.
Nest (Nest JS) is a progressive Node.js framework for building efficient,
reliable and scalable server-side applications.
Hive Gateway provides its own Nest GraphQL Driver that supports building
GraphQL Federation gateways.
Install
npm i @nestjs/graphql @graphql-hive/nestjs graphql
yarn add @nestjs/graphql @graphql-hive/nestjs graphql
pnpm add @nestjs/graphql @graphql-hive/nestjs graphql
bun add @nestjs/graphql @graphql-hive/nestjs graphql
Create Application Module
import {
HiveGatewayDriver,
HiveGatewayDriverConfig,
} from "@graphql-hive/nestjs";
import { Module } from "@nestjs/common";
import { GraphQLModule } from "@nestjs/graphql";
@Module({
imports: [
GraphQLModule.forRoot<HiveGatewayDriverConfig>({
driver: HiveGatewayDriver,
// All configuration for Hive Gateway comes here;
supergraph: "./supergraph.graphql",
// Install subscription handlers to the server
installSubscriptionHandlers: true,
subscriptions: {
// Enable WebSocket subscriptions
"graphql-ws": true,
},
}),
],
})
export class AppModule {}
Further development
Hive Gateway offers just a gateway driver; meaning, everything else works as
showcased in Nest federation documentation.