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

gqlarr

v0.0.7

Published

A utility for implementing the Almighty Root Resolver pattern in GraphQL in type-safe manner.

Readme

GQLARR

GQLARR (GraphQL Almighty Root Resolver, pronounced "G-Clar") is a GraphQL Codegen plugin that streamlines the process of implementing the Almighty Root Resolver pattern.

Installation

npm i graphql @graphql-codegen/cli gqlarr

Note that gqlarr should be not be installed as a dev dependency. In addition to the main plugin, there are several helper functions that it exports which your application will require during runtime.

Type Generation

Create a codegen.config.ts file in the root directory of your project, and add contents like these:

import type { CodegenConfig } from '@graphql-codegen/cli';
import type { GQLARRConfig } from 'gqlarr';

const gqlarrConfig: GQLARRConfig = {
  types: {
    DateTime: 'string', // The DateTime scalar will be typed as a string in the output
    InputCoordinates: 'Point', // The InputCoordinates input object type will be typed as a Point
  },
  imports: {
    './point': ['Point'], // Import the Point type from the same directory as the output
  },
};

const config: CodegenConfig = {
  // The location of your schema files
  schema: './src/graphql/**/*.graphql',
  generates: {
    // The file to write output to
    'src/model/graphql-types.ts': {
      plugins: ['gqlarr'], // Specify only gqlarr, the gqlarr plugin does not require the TypeScript plugin
    },
  },
  config: gqlarrConfig,
};

export default config;

Generate the Types

npx graphql-codegen --config codegen.config.ts

Create Your Resolvers

A gqlarr object will be created in the type definition file that is generated. This object has methods specific to the operation types in your schema which can retrieve information about individual fields of those top-level operations. In turn, the retrieved field has information about its fields, and so on. You can use these inside top-level resolvers to build up a database query representing all of the information requested by the client.

Each field object extends the following basic structure:

interface Field {
  name: string;
  on: string;
  alias: string;
  arguments: Record<string, unknown>;
  fields: Field[];
}

All properties except alias, though, will be typed according to your schema. So, for instance, name will actually be a union of string literals representing the possible field names on a given parent. The on property represents the type of the field's parent node. This can be used to resolve fields for specific implementations of an interface when the user has requested them using fragments. arguments contains the actual arguments passed to the field request. The alias property contains an alias if one was provided, but defaults to the name of the field, so you should always use it to name the resultant property in the object you send back to the client. fields is an array of the actual fields requested by the client, and you can switch on the name and on properties of each field to return the correct values to the client. You should get great intellisense in compatible IDEs for all of these properties.