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

@eleven-labs/nest-profiler-graphql

v1.0.0-alpha.3

Published

GraphQL support for @eleven-labs/nest-profiler — Apollo, Mercurius and graphql-yoga

Readme

@eleven-labs/nest-profiler-graphql

@eleven-labs/nest-profiler-graphql captures GraphQL queries and mutations and displays them in the profiler Request tab with a dedicated GraphQL section.

Profiles list showing GQL MUTATION and GQL QUERY badges alongside the operation name and status

Request tab showing the GraphQL section with operation type, operation name, syntax-highlighted query and variables

Installation

pnpm add @eleven-labs/nest-profiler-graphql

Setup

Import ProfilerGraphQLModule alongside ProfilerModule in your application module.

Apollo Server (Express or Fastify)

import { ProfilerModule } from '@eleven-labs/nest-profiler';
import { ProfilerGraphQLModule } from '@eleven-labs/nest-profiler-graphql';

@Module({
  imports: [
    ProfilerModule.forRoot({ isGlobal: true }),
    ProfilerGraphQLModule.forRoot(),
    GraphQLModule.forRoot<ApolloDriverConfig>({
      driver: ApolloDriver,
      autoSchemaFile: true,
      // Required — exposes the Express/Fastify request so the profiler can
      // store and recover the profile across the async context boundary.
      context: ({ req }) => ({ req }),
    }),
  ],
})
export class AppModule {}

Mercurius (Fastify)

(ProfilerGraphQLModule.forRoot(),
  GraphQLModule.forRoot<MercuriusDriverConfig>({
    driver: MercuriusDriver,
    autoSchemaFile: true,
    // Mercurius uses `request` instead of `req`
    context: ({ request }) => ({ request }),
  }));

graphql-yoga (Express or Fastify)

(ProfilerGraphQLModule.forRoot(),
  GraphQLModule.forRoot<YogaDriverConfig>({
    driver: YogaDriver,
    autoSchemaFile: true,
    context: ({ req }) => ({ req }),
  }));

Options

ProfilerGraphQLModule.forRoot({
  enabled?: boolean; // Default: true. Set to false to disable GraphQL profiling.
})

Ignoring playground and introspection requests

The playground and introspection requests are profiled by default. Use the ignoreRequest option of ProfilerModule together with the pre-built filters from this package to exclude them:

import { ProfilerModule, combineFilters } from '@eleven-labs/nest-profiler';
import {
  ProfilerGraphQLModule,
  ignoreGraphQLPlayground,
  ignoreGraphQLIntrospection,
} from '@eleven-labs/nest-profiler-graphql';

ProfilerModule.forRoot({
  isGlobal: true,
  ignoreRequest: combineFilters(ignoreGraphQLPlayground, ignoreGraphQLIntrospection),
}),
ProfilerGraphQLModule.forRoot(),

| Filter | Skips | | ---------------------------- | ---------------------------------------------------------------------------------------------- | | ignoreGraphQLPlayground | GET /graphql with Accept: text/html — the Sandbox UI page load | | ignoreGraphQLIntrospection | Any POST with operationName: IntrospectionQuery or a query referencing __schema / __type |

What is captured

Each profiled GraphQL request shows a GQL badge in /_profiler and records:

| Field | Description | | --------------- | ---------------------------------------------- | | operationType | query, mutation, or subscription | | operationName | Named operation (e.g. GetBooks), if provided | | fieldName | Entry-point resolver field | | query | The full GraphQL document (formatted) | | variables | Variables object |

Registering this module also adds a GraphQL choice to the Type filter on the /_profiler list, so you can narrow the list to GraphQL operations.

GraphQL-level errors (schema validation failures, resolver errors) appear in the Exceptions tab with an amber GraphQLError badge, distinct from NestJS runtime exceptions.

Exceptions tab showing an amber GraphQLError badge with validation error message and location

How it works

ProfilerGraphQLModule registers GraphQLContextAdapter with ProfilerCoreService on module init. The adapter supports all NestJS GraphQL drivers that expose the HTTP request in the execution context:

  • Apollo (Express / Fastify): looks for gqlCtx.req
  • Mercurius (Fastify): looks for gqlCtx.request

A middleware finish hook also captures GraphQL errors for requests that Apollo handles without calling any resolver (e.g. schema validation failures), ensuring those profiles still appear in /_profiler.

Custom protocol adapters

This package is the reference implementation of the IContextAdapter pattern from @eleven-labs/nest-profiler. You can use the same pattern to profile gRPC, Kafka, WebSockets, or any other NestJS execution context — see the @eleven-labs/nest-profiler documentation for a full example.


Part of the nest-profiler toolkit · Powered & maintained by Eleven Labs