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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sucoza/graphql-devtools-plugin

v0.1.9

Published

DevTools plugin for GraphQL query analysis, debugging, and schema introspection

Readme

GraphQL DevTools Plugin

A comprehensive GraphQL DevTools plugin for TanStack DevTools that provides advanced schema exploration, visual query building, operation monitoring, and performance analytics.

Features

🔍 Schema Explorer

  • Interactive Schema Browser: Navigate through GraphQL types, queries, mutations, and subscriptions
  • Type Details: View field descriptions, arguments, deprecation status, and relationships
  • Schema Statistics: Overview of type counts, operations, and schema health
  • Auto-Introspection: Automatically detect and introspect GraphQL endpoints

🛠️ Visual Query Builder

  • Drag & Drop Interface: Build queries visually by selecting fields and configuring arguments
  • Variable Management: Define and manage query variables with type validation
  • Real-time Validation: Instant feedback on query syntax and schema compliance
  • Query Generation: Automatically generate optimized GraphQL queries
  • Query Execution: Execute queries directly from the builder

📊 Operation History

  • Complete Operation Tracking: Monitor all GraphQL queries, mutations, and subscriptions
  • Detailed Operation View: Inspect query, variables, response, and network information
  • Performance Metrics: Track execution times, success rates, and error patterns
  • Operation Replay: Re-execute previous operations for testing
  • Advanced Filtering: Filter by operation type, status, time range, and search terms

📈 Performance Monitoring

  • Execution Time Tracking: Monitor query performance and identify bottlenecks
  • Success Rate Analytics: Track success/failure rates across operations
  • Error Analysis: Categorize and analyze GraphQL errors
  • Performance Trends: Visualize performance metrics over time

🔧 Developer Experience

  • Network Interception: Automatically detect and capture GraphQL operations
  • Export/Import: Export operation history and schema information
  • Dark Mode Support: Full dark/light theme support
  • Responsive Design: Works on all screen sizes
  • TypeScript Support: Fully typed with comprehensive TypeScript definitions

Installation

npm install @sucoza/graphql-devtools-plugin

Quick Start

Basic Setup

import { GraphQLDevToolsPanel, createGraphQLDevToolsClient } from '@sucoza/graphql-devtools-plugin';

// Create the DevTools client
const graphqlDevToolsClient = createGraphQLDevToolsClient();

// Add to your app
function App() {
  return (
    <div>
      {/* Your app content */}
      
      {/* DevTools panel */}
      <GraphQLDevToolsPanel />
    </div>
  );
}

With TanStack DevTools

import { TanStackDevtools } from '@tanstack/react-devtools';
import { GraphQLDevToolsPanel } from '@sucoza/graphql-devtools-plugin';

function App() {
  return (
    <div>
      {/* Your app content */}
      
      <TanStackDevtools>
        <GraphQLDevToolsPanel />
      </TanStackDevtools>
    </div>
  );
}

Configuration

Schema Introspection

Configure endpoints for automatic schema introspection:

import { createGraphQLDevToolsClient } from '@sucoza/graphql-devtools-plugin';

const client = createGraphQLDevToolsClient();

// Add GraphQL endpoints
const schemaManager = client.getSchemaManager();
schemaManager.updateOptions({
  endpoints: ['http://localhost:4000/graphql', '/api/graphql'],
  autoIntrospect: true,
  cacheTimeout: 300000 // 5 minutes
});

Custom Headers

Add custom headers for authenticated endpoints:

// Introspect with custom headers
await client.introspectSchema('http://localhost:4000/graphql', {
  'Authorization': 'Bearer your-token',
  'X-Custom-Header': 'value'
});

Network Interception

The plugin automatically intercepts GraphQL requests. Configure interception options:

const interceptor = client.getInterceptor();

interceptor.updateOptions({
  enabled: true,
  endpoints: ['/graphql', '/api/graphql'],
  autoDetectEndpoints: true,
  maxOperationHistory: 1000
});

API Reference

GraphQLDevToolsClient

const client = createGraphQLDevToolsClient();

// Schema operations
await client.introspectSchema(endpoint, headers);
client.getSchemaManager();

// Query builder
client.setQueryBuilderOperationType('query' | 'mutation' | 'subscription');
client.addQueryBuilderField(field);
client.generateQuery();
client.validateQueryBuilder();

// Operation management
client.clearOperations();
client.getFilteredOperations();
client.exportOperations();

// UI controls
client.selectTab('operations' | 'schema' | 'query-builder' | 'performance');
client.toggleRecording();
client.updateFilters(filters);

React Hooks

import { useGraphQLDevToolsStore } from '@sucoza/graphql-devtools-plugin';

function CustomComponent() {
  const state = useGraphQLDevToolsStore();
  
  return (
    <div>
      <p>Total operations: {state.operations.length}</p>
      <p>Schema loaded: {state.schema.schema ? 'Yes' : 'No'}</p>
    </div>
  );
}

Example Application

The example/ directory contains a full demo application showing all features:

cd example
npm install
npm run dev

The example includes:

  • Mock GraphQL server with sample schema
  • Sample queries and mutations
  • Interactive demo interface
  • DevTools panel integration

Development

Building

npm run build

Testing

npm test
npm run test:ui

Development Mode

npm run dev

Type Checking

npm run typecheck

Schema Requirements

The plugin works best with GraphQL schemas that support introspection. Ensure your GraphQL server has introspection enabled:

// Apollo Server example
const server = new ApolloServer({
  typeDefs,
  resolvers,
  introspection: true,  // Enable introspection
  playground: true      // Optional: enable GraphQL Playground
});

Browser Support

  • Chrome 88+
  • Firefox 85+
  • Safari 14+
  • Edge 88+

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT


Part of the @sucoza TanStack DevTools ecosystem.

Changelog

v1.0.0

  • Initial release
  • Schema exploration and introspection
  • Visual query builder
  • Operation history and monitoring
  • Performance analytics
  • Network interception
  • Export/import functionality