{"id":48677,"library":"nestjs-graphql-relay","title":"NestJS GraphQL Relay","description":"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.","status":"active","version":"11.0.2","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/g59/nestjs-plugins","tags":["javascript","nest","graphql-relay","typeorm","typescript"],"install":[{"cmd":"npm install nestjs-graphql-relay","lang":"bash","label":"npm"},{"cmd":"yarn add nestjs-graphql-relay","lang":"bash","label":"yarn"},{"cmd":"pnpm add nestjs-graphql-relay","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for GraphQL integration in NestJS.","package":"@nestjs/graphql","optional":false},{"reason":"Provides Relay types and utilities.","package":"graphql-relay","optional":false},{"reason":"ORM used for database interactions.","package":"typeorm","optional":false},{"reason":"Used for validation decorators on input types.","package":"class-validator","optional":false}],"imports":[{"note":"Relay is a namespace export, not a default export.","wrong":"import Relay from 'nestjs-graphql-relay'","symbol":"Relay","correct":"import { Relay } from 'nestjs-graphql-relay'"},{"note":"PageInfo is provided by this package, not from @nestjs/graphql.","wrong":"import { PageInfo } from '@nestjs/graphql'","symbol":"PageInfo","correct":"import { PageInfo } from 'nestjs-graphql-relay'"},{"note":"Recommended to import from nestjs-graphql-relay for proper type compatibility.","wrong":"import { ConnectionCursor } from 'graphql-relay'","symbol":"ConnectionCursor","correct":"import { ConnectionCursor } from 'nestjs-graphql-relay'"}],"quickstart":{"code":"import { ObjectType, Field } from '@nestjs/graphql';\nimport { Relay, PageInfo } from 'nestjs-graphql-relay';\n\n@ObjectType({ isAbstract: true })\nabstract class RecipeEdge implements Relay.Edge<Recipe> {\n  @Field(() => Recipe)\n  node: Recipe;\n\n  @Field()\n  cursor: Relay.ConnectionCursor;\n}\n\n@ObjectType()\nexport class RecipeConnection implements Relay.Connection<Recipe> {\n  @Field()\n  pageInfo: PageInfo;\n\n  @Field(() => [RecipeEdge])\n  edges: Array<Relay.Edge<Recipe>>;\n}","lang":"typescript","description":"Defines Relay-compatible edge and connection types using the package's decorators."},"warnings":[{"fix":"Upgrade @nestjs/graphql to 13.1.0+ and graphql-relay to 0.10.2+.","message":"Version 11 requires @nestjs/graphql >=13.1.0 and graphql-relay ^0.10.2. Older versions are incompatible.","severity":"breaking","affected_versions":">=11.0.0"},{"fix":"Use import { Relay } from 'nestjs-graphql-relay' instead of import * from 'nestjs-graphql-relay/dist/...'.","message":"In older versions (<10), the import path was different. Direct imports from subpaths are deprecated.","severity":"deprecated","affected_versions":"<11.0.0"},{"fix":"Always specify the node type (e.g., Relay.Edge<Recipe>) to satisfy type constraints.","message":"The Relay namespace types (Edge, Connection) require generic type parameters. Forgetting them leads to TypeScript errors.","severity":"gotcha","affected_versions":">=11.0.0"},{"fix":"Ensure all entities used in connections have @ObjectType() decorator from @nestjs/graphql.","message":"TypeORM entities must be decorated with @ObjectType() for proper code generation. Missing it causes runtime errors.","severity":"gotcha","affected_versions":">=11.0.0"}],"env_vars":null,"search_vec":"'0.10.2':43 '11.0.2':34 '13.1.0':38 'activ':78 'api':26 'automat':58 'boilerpl':67 'build':21 'compat':24,35 'connect':27,51 'consist':70 'creat':46 'current':30 'decor':17 'definit':61 'edg':28,53 'ensur':69 'entiti':60 'follow':82 'generat':50 'graphql':2,12,25,41,88 'graphql-relay':11,40,87 'implement':64 'info':57 'integr':8 'javascript':85 'librari':76 'maintain':79 'manual':63 'nest':86 'nest.js':5 'nestj':1,83 'nestjs/graphql':9,37 'page':56 'pagin':29,48 'plugin':6 'provid':16 'reduc':66 'relay':3,13,23,42,47,73,89 'relay-compat':22 'releas':81 'simplifi':45 'specif':74 'stabl':31 'type':52,54 'typeorm':15,90 'typescript':91 'unlik':62 'updat':84 'util':19 'version':32","created_at":"2026-06-07T16:57:52.544833+00:00","updated_at":"2026-06-07T16:57:52.544833+00:00","problems":[{"fix":"Run 'npm install nestjs-graphql-relay'. Ensure tsconfig.json includes 'node_modules/@types'.","cause":"Package not installed or missing type definitions.","error":"Cannot find module 'nestjs-graphql-relay' or its corresponding type declarations."},{"fix":"Use import { Relay } from 'nestjs-graphql-relay'.","cause":"Importing Relay from wrong package (e.g., graphql-relay) instead of nestjs-graphql-relay.","error":"Type 'Relay.Edge<Recipe>' is not generic."},{"fix":"Add @Field() decorator to pageInfo and @Field(() => [RecipeEdge]) to edges.","cause":"Missing @Field() decorator on pageInfo or edges field.","error":"Property 'pageInfo' does not exist on type 'RecipeConnection'."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/g59/nestjs-plugins/tree/main/packages/nestjs-graphql-relay","github":"ssh://git@github.com/g59/nestjs-plugins","docs":null,"changelog":null,"pypi":null,"npm":"nestjs-graphql-relay","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}