npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nest-type-graphql

v0.1.2

Published

Bridge Between graphql and typegrapql

Readme

Description

This is a TypeGraphQL module for Nest.

How to use

I manually combine both decorators of Nestjs Graphql with TypeGraphql. idea is that the typegraphql will create the graphql schema but Nestjs will provide the resolvers and other run times.

first install it

npm install nest-type-graphql

This module can only build a GraphQLSchema it does not run a graphQL server , you can simply run a graphql server yourself. for example for apollo server you can make it this way

@Module({
  imports: [TypeGraphQLModule],
})
export class ApolloMdoule implements OnModuleInit {
  apolloServer: ApolloServer;
  constructor(
    private readonly appRefHost: ApplicationReferenceHost,
    private readonly graphQLFactory: SchemaBuilder,
  ) {}
  async onModuleInit() {
    if (!this.appRefHost) {
      return;
    }

    const httpServer = this.appRefHost.applicationRef;
    if (!httpServer) {
      return;
    }

    const app = httpServer.getInstance();
    const schema = await this.graphQLFactory.build();

    this.apolloServer = new ApolloServer({ schema, playground: true });
    this.apolloServer.applyMiddleware({
      app,
    });
  }
}

Changes to TypeGraphQL Decorators

cause the resolvers function is provided by NestJs you cannot use

Changes to Nestjs GraphQL

  • @Resolver does not accept name anymore
  • @Query and @Mutation does not accept name as a field in decorator but you can pass it in options that you provide to decorator.
  • @ResolveProperty is removed use @FieldResolver
  • @Args does not accept name and it will provide the whole arguments input but you can use @Arg for a named argument also if you want to use pipe in @Args and @Arg you should pass an array of pipes to pieps key in options
  • Also you should read the typegraphql manual

Scalar Type

for scalar type you can use @Scalar but it does not accept name anymore you should provide it in class but it accept a type funciton like typegraphQL it

@Scalar(type => Date)
export class DateScalar {
  name = 'Date';
  description = 'Date custom scalar type';

  parseValue(value) {
    return new Date(value); // value from the client
  }

  serialize(value) {
    return value.getTime(); // value sent to the client
  }

  parseLiteral(ast) {
    if (ast.kind === Kind.INT) {
      return parseInt(ast.value, 10); // ast value is always in string format
    }
    return null;
  }
}

then you should use provide it in a module so it will be created and for using this scalar in schema you can use type that you provided in decorator so for this scalar we can simply write this input type

@ObjectType()
class User {
  @Field()
  registrationDate: Date;
}

See The Example

Todos

  • @Subsciption decorator is missing and it's cause the NestJS and Typegraphql has 2 types of signature