A Nest.js plugin that integrates @nestjs/graphql with graphql-relay and TypeORM, providing decorators and utilities for building Relay-compatible GraphQL APIs (connections, edges, pagination). Current stable version is 11.0.2, compatible with @nestjs/graphql >=13.1.0 and graphql-relay ^0.10.2. It simplifies creating Relay pagination by generating connection types, edge types, and page info automatically from entity definitions. Unlike manual implementation, it reduces boilerplate and ensures consistency with the Relay specification. The library is actively maintained, with releases following NestJS updates.
npm install nestjs-graphql-relayNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines Relay-compatible edge and connection types using the package's decorators.
Upgrade @nestjs/graphql to 13.1.0+ and graphql-relay to 0.10.2+.
Use import { Relay } from 'nestjs-graphql-relay' instead of import * from 'nestjs-graphql-relay/dist/...'.Always specify the node type (e.g., Relay.Edge<Recipe>) to satisfy type constraints.
Ensure all entities used in connections have @ObjectType() decorator from @nestjs/graphql.
Run 'npm install nestjs-graphql-relay'. Ensure tsconfig.json includes 'node_modules/@types'.
Use import { Relay } from 'nestjs-graphql-relay'.Add @Field() decorator to pageInfo and @Field(() => [RecipeEdge]) to edges.