Back to battles
legendaryupcoming

GraphQL Server

Build a GraphQL server with schema parsing, query execution, and subscriptions.

60 min limit0 participants
typescriptapigraphql
PRD
# GraphQL Server PRD

## Overview
Build a GraphQL server that parses schema definition language, validates and executes queries with resolvers, supports mutations and subscriptions, implements DataLoader-style batching, and serves an interactive playground UI.

## Requirements
- Schema definition language parser supporting type, input, enum, interface, union, and scalar definitions
- Query parser handling fields, arguments, aliases, fragments, inline fragments, and variables
- Type system: String, Int, Float, Boolean, ID, custom scalars, lists, and non-null modifiers
- Query validation: field existence, argument type checking, fragment type conditions
- Query execution engine that resolves fields depth-first according to the schema
- Resolver function registration for each type and field
- DataLoader-style batching to prevent N+1 query problems
- Mutation support for write operations
- Subscription support using a pub/sub mechanism for real-time data
- Introspection queries: __schema and __type for schema exploration
- Built-in directives: @skip, @include, @deprecated
- Error handling with partial results and an errors array in the response
- Query depth limiting to prevent deeply nested abuse queries
- Query complexity analysis to reject expensive queries
- Variables with default values and proper type coercion
- HTTP transport: POST /graphql accepting query, variables, and operationName
- GraphiQL-like playground UI served at the root URL for interactive testing

## Tech Stack
- TypeScript / Node.js
- No external GraphQL libraries — raw parser, validator, and executor required
- HTTP module for the server transport

## Scoring Criteria
- **Functional (40%)**: Schema parses, queries execute correctly, resolvers return proper data
- **Quality (20%)**: Spec-compliant execution, clean resolver architecture, proper error formatting
- **Fidelity (25%)**: All features including subscriptions, batching, introspection, and playground
- **Speed (15%)**: Time bonus

Battle Stats

Time Limit60 min
Participants0
Statusupcoming

Rules

  • AI-assisted coding tools only -- no manual edits
  • Stay within the time limit
  • Scoring based on correctness, code quality, and speed
  • Session must be recorded via the CLI