Skip to content

Latest commit

 

History

History

nestjs-graphql-relay

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

nestjs-graphql-relay

Actions Status npm version

Nest.js + typeorm + graphql-relay inspired nestjs-graphql-relay

Install

npm install nestjs-graphql-relay

Usage

example resolver

@ObjectType({ isAbstract: true })
abstract class RecipesEdge implements Relay.Edge<Recipe> {
  @Field(() => Recipe)
  readonly node: Recipe;

  @Field()
  readonly cursor: Relay.ConnectionCursor;
}

@ObjectType()
export class RecipesConnection implements Relay.Connection<Recipe> {
  @Field()
  readonly pageInfo: PageInfo;

  @Field(() => [RecipesEdge])
  readonly edges: Array<Relay.Edge<Recipe>>;
}

Contributing

PRs accepted.

License

MIT © g59