Skip to content

Conversation

@productdevbook
Copy link
Owner

@productdevbook productdevbook commented Oct 22, 2025

πŸ“Š GraphQL Debug Dashboard

Adds a new comprehensive debug dashboard at /_nitro/graphql/debug for inspecting GraphQL setup, resolver exports, and generated virtual modules.

CleanShot 2025-10-22 at 22 19 29@2x

✨ Features

1. Color-Coded Resolver Type Badges

  • Each resolver type has unique colors and symbols:
    • β—† Query (blue) - Data fetching operations
    • ● Mutation (GraphQL pink) - Data modifications
    • β–² Type (purple) - Custom type resolvers
    • @ Directive (amber) - Special directives
    • β—‰ Resolver (emerald) - Combined resolvers
    • ↻ Subscription (teal) - Real-time data
  • Instant visual scanning for developers
  • Hover effects and professional typography

2. Virtual Module Source Code Display

  • Displays generated code for 5 virtual modules:
    • #nitro-internal-virtual/server-schemas
    • #nitro-internal-virtual/server-resolvers
    • #nitro-internal-virtual/server-directives
    • #nitro-internal-virtual/module-config
    • #nitro-internal-virtual/graphql-config
  • Expandable/collapsible code blocks
  • Shows line count and byte size for each module
  • One-click copy-to-clipboard functionality
  • Scrollable code blocks with syntax highlighting

3. GraphQL Corporate Branding

  • Uses official GraphQL pink (#E535AB) as primary accent
  • Official GraphQL logo SVG in header
  • Professional slate gray color palette
  • Enterprise-ready design with Tailwind CSS v4
  • Custom scrollbars for better UX

4. Comprehensive Statistics

  • Environment info (dev mode, framework, GraphQL server)
  • Scanned files count (schemas, resolvers, directives, documents)
  • Runtime loaded modules count
  • File path listings with hover effects

5. Developer Experience

  • Responsive grid layouts
  • Scrollable lists for 100+ resolvers
  • JSON API endpoint with ?format=json
  • Real-time reload button
  • Only available in development mode

πŸ“Έ Screenshots

See the dashboard displaying:

  • Resolver exports with type badges
  • Virtual module source code
  • File listings
  • Statistics cards

πŸ”§ Technical Changes

New Files:

  • src/routes/debug.ts - Debug dashboard endpoint

Modified Files:

  • src/index.ts - Register debug route and add startup diagnostics
  • src/rollup.ts - Add virtualDebugInfo() with generated code collection
  • src/virtual.d.ts - Add virtualModules field to debug info type
  • tsdown.config.ts - Add debug route to build entries

πŸ§ͺ Testing

Tested in:

  • Nitro playground
  • Nuxt playground
  • With 100+ resolver exports
  • All virtual modules displaying correctly

πŸ“š Related

Part of ongoing improvements to developer experience and debugging capabilities.

πŸ€– Generated with Claude Code

productdevbook and others added 4 commits October 22, 2025 22:11
- Add new debug endpoint at /_nitro/graphql/debug
- Display environment, scanned files, and runtime info
- Show resolver exports with color-coded type badges
- Add virtual module inspection
- Implement GraphQL brand colors and professional design
- Support scrollable lists for large resolver counts
- Add JSON API endpoint with ?format=json

Features:
- Color-coded resolver types (query/mutation/type/directive)
- Unique symbols for each resolver type
- Tailwind CSS v4 with custom scrollbars
- GraphQL pink (#E535AB) brand theming
- Responsive grid layouts
- File path listings for schemas and documents

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add virtualModules field to debugInfo with generated code
- Create expandable/collapsible details for each virtual module
- Show module statistics (line count, byte size)
- Add copy-to-clipboard functionality for each module
- Color-code modules by type (schemas, resolvers, directives, config)
- Display modules:
  - server-schemas (blue)
  - server-resolvers (GraphQL pink)
  - server-directives (amber)
  - module-config (purple)
  - graphql-config (emerald)

Improvements:
- Users can now inspect generated VFS code at runtime
- Each module shows size and line count
- One-click copy functionality
- Scrollable code blocks with max-height
- Professional color coding matching resolver types

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Fix virtualModules field to use debugInfo.virtualModules (string code)
- Rename runtime sample data to virtualModuleSamples
- Add null check for virtualModules to prevent errors
- Now displays actual generated TypeScript/JavaScript code

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add type casting for virtual module generators (as string)
- Add explicit any types for import map parameters
- Fix Promise<string> | string type conflicts

πŸ€– Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@productdevbook productdevbook merged commit 02f510f into main Oct 22, 2025
1 check passed
@productdevbook productdevbook deleted the feat/debug-dashboard-improvements branch October 22, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants