Skip to content

Conversation

@productdevbook
Copy link
Owner

Summary

  • Added WebSocket support for GraphQL subscriptions using graphql-ws and graphql-sse protocols
  • Created new webhook playground demonstrating real-time subscription functionality
  • Added optional peer dependencies for graphql-ws and graphql-sse
  • Improved logging and message handling in WebSocket implementation
  • Renamed existing playground packages for better clarity

Key Changes

Core Features

  • WebSocket Support: Integrated graphql-ws and graphql-sse for real-time GraphQL subscriptions
  • Protocol Support: Supports both WebSocket (graphql-ws) and SSE (graphql-sse) protocols
  • Optional Dependencies: Added graphql-ws and graphql-sse as optional peer dependencies

Webhook Playground

  • Created new webhook playground with full subscription demo
  • Implemented userCreated subscription example with PubSub
  • Added interactive UI showing real-time user creation events
  • Includes query, mutation, and subscription examples

Package Organization

  • Renamed nitro-graphql-examplenitro-playground
  • Renamed nitro-graphql-apolloapollo-playground
  • Renamed nitro-appvite-playground
  • Added webhook-playground for WebSocket/subscription testing

Test Plan

  • Test WebSocket connection establishment
  • Test GraphQL subscription functionality
  • Test mutation triggering subscription events
  • Test PubSub message delivery
  • Test both graphql-ws and graphql-sse protocols
  • Verify optional dependencies work correctly
  • Test in webhook playground environment

Technical Details

Files Modified:

  • package.json - Added optional peer dependencies for WebSocket support
  • src/routes/graphql-yoga-ws.ts - WebSocket route implementation (if exists)
  • Playground configurations updated

New Files:

  • playgrounds/webhook/ - Complete subscription demo playground
  • playgrounds/webhook/server/graphql/user/*.resolver.ts - User query/mutation/subscription resolvers
  • playgrounds/webhook/server/graphql/user/pubsub.ts - In-memory PubSub implementation

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

productdevbook and others added 4 commits November 11, 2025 11:11
- Introduced new WebSocket handlers for Apollo Server and GraphQL Yoga.
- Updated pnpm workspace configuration to include new dependencies for WebSocket handling.
- Enhanced setup to register WebSocket endpoints based on configuration.
- Added WebSocket client generation for both main and external GraphQL services.
- Implemented schema merging logic to support federation with WebSocket subscriptions.
- Updated types to include WebSocket configuration options.
- Resolved conflicts in package.json, pnpm-workspace.yaml, src/setup.ts,
  src/utils/type-generation.ts, pnpm-lock.yaml
- Integrated WebSocket client generation into modular codegen structure
- Added generateWebSocketTemplate utility for WS client code generation
- Updated client-types.ts and external-types.ts with WS support

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 11, 2025

Deploying nitro-graphql with  Cloudflare Pages  Cloudflare Pages

Latest commit: 73f7f50
Status:🚫  Build failed.

View logs

@productdevbook productdevbook marked this pull request as draft January 7, 2026 11:28
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