Node.js
Expert
Building a GraphQL API with DataLoader to solve the N+1 problem

Type d'évaluation

Mise en situation réelle

Analyse

Intelligence Artificielle

Compétences ciblées

nodejs
graphql
dataloader
n-plus-one
performance

Scénario Technique

Context A GraphQL API resolving a list of posts with their authors triggers one database query per post to fetch the author, causing 101 queries for a list of 100 posts. The Problem Nested resolvers run independently per item, generating an N+1 query pattern that degrades performance at scale. Constraints Implement DataLoader to batch and cache author lookups per request. Instantiate a fresh DataLoader per request to prevent data leakage between users. Demonstrate the reduction from N+1 to 2 queries with a query log. Expected Deliverable A Node.js GraphQL API using DataLoader to batch database calls, reducing N+1 query patterns to batched queries with per-request cache isolation.

Prêt à évaluer ce talent ?

Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.

Commencer le Défis
    Node.js - Building a GraphQL API with DataLoader to solve the N+1 problem | Défi Technique & Recrutement — CodeDuel