[Feature] Add GraphQL Support
Labels
enhancement, graphql, good first issue
Problem Statement
Currently, RestBolt focuses on REST APIs. However, many modern applications use GraphQL, and developers need a good tool to test GraphQL queries, mutations, and subscriptions.
Proposed Solution
Phase 1: Basic GraphQL Support
- Add a "GraphQL" tab in the Request Builder (next to Body, Headers, etc.)
- GraphQL query editor with syntax highlighting (Monaco editor)
- Variables input section (JSON format)
- Support for queries and mutations
- Formatted GraphQL response viewer
Phase 2: Advanced Features
- Introspection - Auto-fetch schema from GraphQL endpoint
- Autocomplete - IntelliSense based on schema
- Query Builder - Visual query builder (like GraphiQL)
- Subscriptions - Real-time GraphQL subscriptions support
- Schema Explorer - Browse available types, queries, mutations
Technical Approach
// Add to Request type
interface Request {
// ... existing fields
graphql?: {
query: string;
variables?: Record<string, any>;
operationName?: string;
}
}
// GraphQL service
class GraphQLService {
async executeQuery(endpoint: string, query: string, variables?: any) {
// Implementation
}
async introspectSchema(endpoint: string) {
// Fetch schema using introspection query
}
}
UI Mockup
┌─────────────────────────────────────────┐
│ Request Builder │
├─────────────────────────────────────────┤
│ [Params] [Headers] [Body] [GraphQL] │ ← New tab
├─────────────────────────────────────────┤
│ │
│ Query: │
│ ┌───────────────────────────────────┐ │
│ │ query GetUser($id: ID!) { │ │
│ │ user(id: $id) { │ │
│ │ id │ │
│ │ name │ │
│ │ email │ │
│ │ } │ │
│ │ } │ │
│ └───────────────────────────────────┘ │
│ │
│ Variables: │
│ ┌───────────────────────────────────┐ │
│ │ { │ │
│ │ "id": "123" │ │
│ │ } │ │
│ └───────────────────────────────────┘ │
│ │
│ [Introspect Schema] [Send Query] │
└─────────────────────────────────────────┘
Implementation Steps
-
Phase 1 (2-3 days)
-
Phase 2 (3-4 days)
-
Phase 3 (Optional - 2-3 days)
Libraries to Consider
graphql - Core GraphQL library
@graphiql/toolkit - GraphiQL components (optional)
graphql-ws - GraphQL subscriptions over WebSocket
- Monaco editor already supports GraphQL syntax highlighting
Acceptance Criteria
Priority
Medium - Not critical for core functionality, but important for broader adoption
Estimated Effort
5-7 days for full implementation with advanced features
2-3 days for basic query execution only
References
[Feature] Add GraphQL Support
Labels
enhancement,graphql,good first issueProblem Statement
Currently, RestBolt focuses on REST APIs. However, many modern applications use GraphQL, and developers need a good tool to test GraphQL queries, mutations, and subscriptions.
Proposed Solution
Phase 1: Basic GraphQL Support
Phase 2: Advanced Features
Technical Approach
UI Mockup
Implementation Steps
Phase 1 (2-3 days)
Phase 2 (3-4 days)
Phase 3 (Optional - 2-3 days)
Libraries to Consider
graphql- Core GraphQL library@graphiql/toolkit- GraphiQL components (optional)graphql-ws- GraphQL subscriptions over WebSocketAcceptance Criteria
Priority
Medium - Not critical for core functionality, but important for broader adoption
Estimated Effort
5-7 days for full implementation with advanced features
2-3 days for basic query execution only
References