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

apollo-q-prof

v2.2.2

Published

Apollo query profiler

Downloads

67

Readme

Query profiler for Apollo Server 2

Dependencies

Apollo Server is a community-maintained open-source GraphQL server. This Query Profiler project try to make super easy to control how many and which requests are called when a query is executed.

Getting started

  1. npm i -D apollo-q-prof
  2. Replace app = new ApolloServer({configData}) by app = ApolloQProf({configData})
  3. Run your application and that's all!

Configuration (Experimental)

There is a second [optional] argument to provide a configuration. The current version only accept an ApolloServer object. So if you are using apollo-server-express you can provide you object and version and use it.

{
  apolloInstance: ApolloServer,
  enabled: Boolean
}

Example:

// Just an example
import ApolloServer from 'apollo-server-express';

const server = ApolloQProf({
  schema,
  debug: true,
  dataSources: () => dataSources,
  context: (): AppContextWithoutDataSources => {
    return {
      locale: "",
      authHeaders: {},
      cookies: {}
    };
  }
}, {
  apolloInstance: ApolloServer,
  enabled: true
});

The service is enabled by default

Running the UI

Apollo-Q-Prof provide an UI to be able to see the generated json file with the information about the request/responses. To be able to use it you need to do the following:

  1. In your project, open you package.json and update the scripts section with a new command like:
{
  ...,
  scripts: {
    ...,
    "ui-prof": "apollo-q-prof-ui"
  }
}
  1. Ejecute the command: npm run ui-prof
  2. Open a browser and go to the url: http://localhost:9000 (or a different port - check the console)
  3. Now you can open the file apollo-q-prof.json located in the root folder of your project (the one generated by the profiler).
  4. Refresh it when you want to see new data.

Structure of JSON file

[
  {
    "outgoingRequests": [
      {
        "startTimestamp": "0",
        "endsTimestamp": "1",
        "params": "[ 'parameter1',... ,'paramenterN' ]",
        "executionTime": "time in ms",
        "method": "",
        "dataSource": ""
      },
      ...
    ],
    "request": {
      "operationName": "",
      "variables": {},
      "query": "{...}"
    },
    "response": {
      "startTimestamp": "0",
      "endsTimestamp": "1",
      "executionTime": "time in ms"
    }
  },
]

Upcoming versions

There are some improvements that we are going to include in upcoming versions like:

  • Timeline for each request
  • Real-time monitoring
  • Statitics and Graphs