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

graphql-docs-scope

v1.0.3

Published

A beautiful React library for exploring GraphQL schemas interactively

Readme

GraphQL Doc Scope

A beautiful, interactive React library for exploring GraphQL schemas. Built with TypeScript, Framer Motion, and Shiki for a delightful developer experience.

License: MIT

✨ Features

  • 🎨 Beautiful UI - Modern, clean design with smooth animations
  • 🌓 Dark/Light Mode - Built-in theme support with customizable colors
  • 🔍 Interactive Exploration - Hover to preview types, click to add them to the view
  • 📦 Type Safe - Built with TypeScript for full type safety
  • 🎭 Smooth Animations - Powered by Framer Motion for buttery transitions
  • 💅 Syntax Highlighting - VSCode-quality highlighting with Shiki
  • 🎯 Smart Deduplication - Never shows the same type twice
  • 🪶 Lightweight - Minimal dependencies, optimized bundle size

📦 Installation

npm install graphql-doc-scope
# or
pnpm add graphql-doc-scope
# or
yarn add graphql-doc-scope

🚀 Quick Start

import { GraphQLDocScope } from 'graphql-doc-scope';
import type { IntrospectionResult } from 'graphql-doc-scope';

// Your GraphQL introspection schema
const schema: IntrospectionResult = {
  __schema: {
    // ... introspection data
  }
};

// Get a field or type to start from
const queryType = schema.__schema.queryType;
const fields = schema.__schema.types.find(t => t.name === 'Query')?.fields || [];
const targetField = fields[0];

function App() {
  return (
    <GraphQLDocScope
      schema={schema}
      target={targetField}
      colorMode="light"
    />
  );
}

📖 API

Props

GraphQLDocScope

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | schema | IntrospectionResult | Yes | - | GraphQL introspection schema JSON | | target | Type \| Field | Yes | - | Initial type or field to display | | colorMode | 'light' \| 'dark' | No | 'light' | Color theme mode | | theme | Partial<Theme> | No | - | Custom theme colors | | className | string | No | '' | Additional CSS class names | | style | React.CSSProperties | No | {} | Inline styles |

Types

interface IntrospectionResult {
  __schema: Schema;
}

interface Theme {
  light: ThemeColors;
  dark: ThemeColors;
}

interface ThemeColors {
  background: string;
  text: string;
  accent: string;
  border: string;
  hover: string;
  preview: string;
}

🎨 Theming

GraphQL Doc Scope comes with beautiful default themes for both light and dark modes. You can customize them:

<GraphQLDocScope
  schema={schema}
  target={targetField}
  colorMode="dark"
  theme={{
    dark: {
      background: '#1a1a1a',
      text: '#f5f5f5',
      accent: '#00ff88',
      border: '#333',
      hover: '#2a2a2a',
      preview: '#252525',
    }
  }}
/>

🎯 How It Works

  1. Initialize - Start with a Query, Mutation, or Subscription field
  2. View - The component shows the field in its parent type context with beautiful syntax highlighting
  3. Discover - Type references in the code have dotted underlines indicating they're interactive
  4. Hover - Hover over an underlined type name to see a preview of its definition appear below
  5. Click - Click on the type name to permanently add its definition to the view
  6. Explore - Continue clicking on referenced types to explore deeper into the schema
  7. Deduplicate - Each type is only displayed once; already-displayed types aren't interactive

Interactive Features

  • Dotted underline on type references that can be explored
  • Solid underline + color change on hover
  • Preview appears below the block you're hovering on (not as overlay)
  • Smooth animations when adding new types
  • Smart filtering - types already in view aren't shown as clickable

🔧 Development

Setup

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Build library
pnpm build:lib

# Build example app
pnpm build

Project Structure

graphql-docs-scope/
├── src/
│   ├── lib/           # Library source code
│   │   ├── GraphQLDocScope.tsx
│   │   ├── SchemaParser.ts
│   │   ├── CodeGenerator.ts
│   │   ├── types.ts
│   │   ├── theme.ts
│   │   └── index.ts
│   └── example/       # Example application
│       ├── App.tsx
│       ├── main.tsx
│       └── index.css
├── latest.json        # Example schema
└── package.json

🏗️ Built With

📝 License

MIT © [Your Name]

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

💡 Use Cases

  • API Documentation - Beautiful, interactive API docs
  • Developer Tools - Schema exploration in dev tools
  • Education - Teaching GraphQL schema design
  • Debugging - Understanding complex schema relationships

🌟 Why GraphQL Doc Scope?

Most GraphQL schemas grow large and complex quickly. Traditional documentation is static and hard to navigate. GraphQL Doc Scope makes exploration interactive and intuitive, letting you discover types naturally as you explore your schema from the inside out.


Made with ❤️ for the GraphQL community