submissionId stringlengths 25 25 | title stringlengths 17 64 | payload dict |
|---|---|---|
cmssjuu6l00ysjmp2pe9019t5 | Submission 9019T5 | {
"sample_query": "{ pagination(total: 53, page: 3, size: 10) { offset count hasNext pages } }",
"resolver_code": "Query: { pagination: (_, a) => { const pages=Math.ceil(a.total/a.size),offset=(a.page-1)*a.size,count=Math.max(0,Math.min(a.size,a.total-offset)); return {offset,count,hasNext:a.page<pages,pages}; } }"... |
cmssjuu6l00ytjmp2bj9cb92t | Submission 9CB92T | {
"sample_query": "{ temperatureBand(celsius: 31, low: 18, high: 27) { fahrenheit state distance } }",
"resolver_code": "Query: { temperatureBand: (_, a) => { const state=a.celsius<a.low?'low':a.celsius>a.high?'high':'normal'; const distance=state==='low'?a.low-a.celsius:state==='high'?a.celsius-a.high:0; return {f... |
cmssjuu6l00yvjmp22qhvqlhl | Submission HVQLHL | {
"sample_query": "{ loanPayment(principal: 1200, annualPct: 0, months: 12) { monthly total interest } }",
"resolver_code": "Query: { loanPayment: (_, a) => { const r=a.annualPct/1200; const monthly=r===0?a.principal/a.months:a.principal*r/(1-(1+r)**(-a.months)); return {monthly,total:monthly*a.months,interest:mont... |
cmssjuu6l00ywjmp2rrwf3z8k | Submission WF3Z8K | {
"sample_query": "{ inventoryStatus(stock: 12, reserved: 15, reorderAt: 5) { available reorder shortage } }",
"resolver_code": "Query: { inventoryStatus: (_, a) => { const available=Math.max(0,a.stock-a.reserved); return {available,reorder:available<=a.reorderAt,shortage:Math.max(0,a.reserved-a.stock)}; } }",
"e... |
cmssjuu6l00yxjmp2uub63wxr | Submission B63WXR | {
"sample_query": "{ checksumStats(a: 17, b: 29, modulus: 11) { sum product checksum } }",
"resolver_code": "Query: { checksumStats: (_, a) => { const sum=a.a+a.b,product=a.a*a.b; return {sum,product,checksum:(sum+product)%a.modulus}; } }",
"expected_response": "{\"data\":{\"checksumStats\":{\"sum\":46,\"product\... |
cmssjuu6l00yyjmp2lx00l6q5 | Submission 00L6Q5 | {
"sample_query": "{ vectorDistance(x1: -2, y1: 3, x2: 4, y2: -5) { dx dy euclidean manhattan } }",
"resolver_code": "Query: { vectorDistance: (_, a) => { const dx=a.x2-a.x1,dy=a.y2-a.y1; return {dx,dy,euclidean:Math.hypot(dx,dy),manhattan:Math.abs(dx)+Math.abs(dy)}; } }",
"expected_response": "{\"data\":{\"vecto... |
cmssjuu6l00yzjmp24mwdfu07 | Submission WDFU07 | {
"sample_query": "{ blendColor(r1: 20, g1: 40, b1: 60, r2: 220, g2: 140, b2: 80, ratio: 0.25) { r g b hex } }",
"resolver_code": "Query: { blendColor: (_, a) => { const v=['r','g','b'].map((_,i)=>Math.round([a.r1,a.g1,a.b1][i]*(1-a.ratio)+[a.r2,a.g2,a.b2][i]*a.ratio)); return {r:v[0],g:v[1],b:v[2],hex:'#'+v.map(x=... |
cmssjuu6l00z0jmp2ou7rgpp8 | Submission 7RGPP8 | {
"sample_query": "{ compression(original: 1000, compressed: 620, overhead: 30) { saved ratio beneficial } }",
"resolver_code": "Query: { compression: (_, a) => { const effective=a.compressed+a.overhead,saved=a.original-effective; return {saved,ratio:effective/a.original,beneficial:saved>0}; } }",
"expected_respo... |
cmssjuu6l00z1jmp2va5u4iqu | Submission 5U4IQU | {
"sample_query": "{ latencyPercent(total: 250, fast: 210, timeout: 8) { success fastPct timeoutPct } }",
"resolver_code": "Query: { latencyPercent: (_, a) => { const success=a.total-a.timeout; return {success,fastPct:a.fast/a.total*100,timeoutPct:a.timeout/a.total*100}; } }",
"expected_response": "{\"data\":{\"l... |
cmssjuu6l00z2jmp2tjglp8rj | Submission GLP8RJ | {
"sample_query": "{ triangleClass(a: 5, b: 5, c: 8) { valid kind perimeter } }",
"resolver_code": "Query: { triangleClass: (_, a) => { const valid=a.a+a.b>a.c&&a.a+a.c>a.b&&a.b+a.c>a.a; const kind=!valid?'invalid':a.a===a.b&&a.b===a.c?'equilateral':a.a===a.b||a.b===a.c||a.a===a.c?'isosceles':'scalene'; return {val... |
cmssjuu6l00z3jmp2c8o1uggq | Submission O1UGGQ | {
"sample_query": "{ workSplit(minutes: 130, focus: 25, breakMin: 5) { cycles focusMinutes breakMinutes } }",
"resolver_code": "Query: { workSplit: (_, a) => { const cycles=Math.floor(a.minutes/(a.focus+a.breakMin)); return {cycles,focusMinutes:cycles*a.focus,breakMinutes:cycles*a.breakMin}; } }",
"expected_respo... |
cmssjuu6l00z4jmp2hfoy4oky | Submission OY4OKY | {
"sample_query": "{ bandwidthCost(gb: 137.5, included: 100, unitCost: 0.08) { billable charge overage } }",
"resolver_code": "Query: { bandwidthCost: (_, a) => { const billable=Math.max(0,a.gb-a.included); return {billable,charge:billable*a.unitCost,overage:billable>0}; } }",
"expected_response": "{\"data\":{\"b... |
cmssjuu6l00z5jmp2dpeh9iwg | Submission EH9IWG | {
"sample_query": "{ weightedVote(yes: 37, no: 11, abstain: 12, threshold: 0.66) { participation yesPct passed } }",
"resolver_code": "Query: { weightedVote: (_, a) => { const participation=a.yes+a.no,yesPct=a.yes/participation; return {participation,yesPct,passed:yesPct>=a.threshold}; } }",
"expected_response": ... |
cmssjuu6l00z6jmp2lb6mdwz1 | Submission 6MDWZ1 | {
"sample_query": "{ diskWatermark(used: 870, capacity: 1000, high: 80, critical: 90) { pct state free } }",
"resolver_code": "Query: { diskWatermark: (_, a) => { const pct=a.used/a.capacity*100,state=pct>=a.critical?'critical':pct>=a.high?'high':'normal'; return {pct,state,free:a.capacity-a.used}; } }",
"expecte... |
cmssjuu6l00z7jmp2mvgcoufg | Submission GCOUFG | {
"sample_query": "{ batchSizing(records: 103, bytesPer: 24, maxBytes: 500) { perBatch batches finalBatch } }",
"resolver_code": "Query: { batchSizing: (_, a) => { const perBatch=Math.floor(a.maxBytes/a.bytesPer),batches=Math.ceil(a.records/perBatch); return {perBatch,batches,finalBatch:a.records-(batches-1)*perBat... |
cmssjuu6l00z8jmp22fe6ez1z | Submission E6EZ1Z | {
"sample_query": "{ retention(createdDay: 100, currentDay: 131, keepDays: 30) { age expiresDay expired } }",
"resolver_code": "Query: { retention: (_, a) => { const age=a.currentDay-a.createdDay,expiresDay=a.createdDay+a.keepDays; return {age,expiresDay,expired:a.currentDay>expiresDay}; } }",
"expected_response"... |
cmssjuu6l00z9jmp2lcb0klyh | Submission B0KLYH | {
"sample_query": "{ tokenBudget(limit: 4096, prompt: 1800, reserve: 300, requested: 2500) { available granted truncated } }",
"resolver_code": "Query: { tokenBudget: (_, a) => { const available=Math.max(0,a.limit-a.prompt-a.reserve),granted=Math.min(a.requested,available); return {available,granted,truncated:grant... |
cmssjuu6l00zajmp2gptgeeak | Submission TGEEAK | {
"sample_query": "{ funnel(visits: 800, trials: 120, paid: 30) { visitToTrial trialToPaid overall } }",
"resolver_code": "Query: { funnel: (_, a) => { return {visitToTrial:a.trials/a.visits,trialToPaid:a.paid/a.trials,overall:a.paid/a.visits}; } }",
"expected_response": "{\"data\":{\"funnel\":{\"visitToTrial\":0... |
cmssjuu6l00zbjmp288h23z75 | Submission H23Z75 | {
"sample_query": "{ queueDrain(queued: 95, workers: 4, perMinute: 7, incoming: 3) { netRate minutes stable } }",
"resolver_code": "Query: { queueDrain: (_, a) => { const netRate=a.workers*a.perMinute-a.incoming,stable=netRate>0; return {netRate,minutes:stable?Math.ceil(a.queued/netRate):0,stable}; } }",
"expecte... |
cmssjuu6l00zcjmp2938dp8e3 | Submission 8DP8E3 | {
"sample_query": "{ mapScale(value: 75, inMin: 0, inMax: 100, outMin: -1, outMax: 1) { ratio mapped clamped } }",
"resolver_code": "Query: { mapScale: (_, a) => { const ratio=(a.value-a.inMin)/(a.inMax-a.inMin),mapped=a.outMin+ratio*(a.outMax-a.outMin); return {ratio,mapped,clamped:Math.max(a.outMin,Math.min(a.out... |
cmssjuu6l00zdjmp2597cf164 | Submission 7CF164 | {
"sample_query": "{ replicaHealth(desired: 8, ready: 6, unavailable: 2) { readyPct degraded missing } }",
"resolver_code": "Query: { replicaHealth: (_, a) => { return {readyPct:a.ready/a.desired*100,degraded:a.ready<a.desired||a.unavailable>0,missing:Math.max(0,a.desired-a.ready)}; } }",
"expected_response": "{\... |
cmssjuu6l00zejmp2ifvcldct | Submission VCLDCT | {
"sample_query": "{ taxBracket(income: 70000, allowance: 12000, rate1: 0.2, cutoff: 40000, rate2: 0.4) { taxable tax marginal } }",
"resolver_code": "Query: { taxBracket: (_, a) => { const taxable=Math.max(0,a.income-a.allowance),low=Math.min(taxable,a.cutoff),high=Math.max(0,taxable-a.cutoff); return {taxable,tax... |
cmssjuu6l00zgjmp24u0up13u | Submission 0UP13U | {
"sample_query": "{ timeOverlap(aStart: 2, aEnd: 11, bStart: 7, bEnd: 15) { overlap union intersects } }",
"resolver_code": "Query: { timeOverlap: (_, a) => { const overlap=Math.max(0,Math.min(a.aEnd,a.bEnd)-Math.max(a.aStart,a.bStart)); const union=Math.max(a.aEnd,a.bEnd)-Math.min(a.aStart,a.bStart); return {over... |
cmssjuu6l00zhjmp23bj7fmmm | Submission J7FMMM | {
"sample_query": "{ geoTile(x: 5, y: 2, zoom: 3) { maxIndex valid flippedY } }",
"resolver_code": "Query: { geoTile: (_, a) => { const maxIndex=2**a.zoom-1,valid=a.x>=0&&a.y>=0&&a.x<=maxIndex&&a.y<=maxIndex; return {maxIndex,valid,flippedY:maxIndex-a.y}; } }",
"expected_response": "{\"data\":{\"geoTile\":{\"maxI... |
cmssjuu6l00zijmp2s657fxtp | Submission 57FXTP | {
"sample_query": "{ dedupeEstimate(total: 1000, unique: 760, falsePositivePct: 2) { duplicates adjustedUnique reductionPct } }",
"resolver_code": "Query: { dedupeEstimate: (_, a) => { const duplicates=a.total-a.unique,adjustedUnique=a.unique+a.total*a.falsePositivePct/100; return {duplicates,adjustedUnique,reducti... |
cmssjuu6l00zjjmp2i4egjlzy | Submission EGJLZY | {
"sample_query": "{ rotation(index: 8, shift: 7, length: 10) { normalizedShift newIndex wrapped } }",
"resolver_code": "Query: { rotation: (_, a) => { const normalizedShift=((a.shift%a.length)+a.length)%a.length,newIndex=(a.index+normalizedShift)%a.length; return {normalizedShift,newIndex,wrapped:a.index+normalize... |
cmssjuu6l00zkjmp2mhi96lyu | Submission I96LYU | {
"sample_query": "{ hashPartition(hash: 17, partitions: 5, replicas: 3) { primary replicas distinct } }",
"resolver_code": "Query: { hashPartition: (_, a) => { const primary=((a.hash%a.partitions)+a.partitions)%a.partitions,replicas=Array.from({length:Math.min(a.replicas,a.partitions)},(_,i)=>(primary+i)%a.partiti... |
cmssjuu6l00zljmp236o41j34 | Submission O41J34 | {
"sample_query": "{ speedup(serial: 120, parallel: 35, cores: 4) { speedup efficiency saved } }",
"resolver_code": "Query: { speedup: (_, a) => { const speedup=a.serial/a.parallel; return {speedup,efficiency:speedup/a.cores,saved:a.serial-a.parallel}; } }",
"expected_response": "{\"data\":{\"speedup\":{\"speedup... |
cmssjuu6l00zmjmp2c79vh9q3 | Submission 9VH9Q3 | {
"sample_query": "{ errorBudget(requests: 50000, failures: 18, targetPct: 99.95) { allowedFailures consumedPct remaining } }",
"resolver_code": "Query: { errorBudget: (_, a) => { const allowedFailures=a.requests*(1-a.targetPct/100); return {allowedFailures,consumedPct:a.failures/allowedFailures*100,remaining:allow... |
cmssjuu6l00znjmp2khjd3k1d | Submission JD3K1D | {
"sample_query": "{ storageTier(daysOld: 45, accesses: 2, hotDays: 30, minAccess: 5) { tier archive score } }",
"resolver_code": "Query: { storageTier: (_, a) => { const archive=a.daysOld>a.hotDays&&a.accesses<a.minAccess,tier=archive?'cold':a.daysOld>a.hotDays?'warm':'hot'; return {tier,archive,score:a.accesses-a... |
cmssjuu6l00zojmp2c9uc80p7 | Submission UC80P7 | {
"sample_query": "{ bookingCapacity(capacity: 10, booked: 8, requested: 5, waitlist: true) { confirmed waitlisted remaining } }",
"resolver_code": "Query: { bookingCapacity: (_, a) => { const free=Math.max(0,a.capacity-a.booked),confirmed=Math.min(free,a.requested),waitlisted=a.waitlist?a.requested-confirmed:0; re... |
cmssjuu6l00zpjmp2v0dihwdp | Submission DIHWDP | {
"sample_query": "{ qualityGate(tests: 240, failed: 0, coverage: 87.5, minCoverage: 85) { passRate coverageOk release } }",
"resolver_code": "Query: { qualityGate: (_, a) => { const passRate=(a.tests-a.failed)/a.tests,coverageOk=a.coverage>=a.minCoverage; return {passRate,coverageOk,release:a.failed===0&&coverageO... |
cmssjuu6l00zqjmp2065kuj35 | Submission 5KUJ35 | {
"sample_query": "{ currencySpread(bid: 1.23, ask: 1.25, quantity: 400) { mid spread cost } }",
"resolver_code": "Query: { currencySpread: (_, a) => { const mid=(a.bid+a.ask)/2,spread=a.ask-a.bid; return {mid,spread,cost:a.ask*a.quantity}; } }",
"expected_response": "{\"data\":{\"currencySpread\":{\"mid\":1.24,\... |
cmssjuu6l00zrjmp24w0i17s4 | Submission 0I17S4 | {
"sample_query": "{ signalWindow(samples: 20, positives: 15, minSamples: 12, threshold: 0.7) { rate enough triggered } }",
"resolver_code": "Query: { signalWindow: (_, a) => { const rate=a.positives/a.samples,enough=a.samples>=a.minSamples; return {rate,enough,triggered:enough&&rate>=a.threshold}; } }",
"expecte... |
cmssjuu6l00zsjmp20usoxk7z | Submission SOXK7Z | {
"sample_query": "{ migrationPlan(rows: 12500, rate: 300, downtimeMin: 40) { copyMinutes withinDowntime overflow } }",
"resolver_code": "Query: { migrationPlan: (_, a) => { const copyMinutes=Math.ceil(a.rows/a.rate),overflow=Math.max(0,copyMinutes-a.downtimeMin); return {copyMinutes,withinDowntime:overflow===0,ove... |
cmssjuu6l00ztjmp269whdcvh | Submission WHDCVH | {
"sample_query": "{ seatPricing(seats: 14, included: 5, base: 60, extraRate: 8) { extraSeats subtotal average } }",
"resolver_code": "Query: { seatPricing: (_, a) => { const extraSeats=Math.max(0,a.seats-a.included),subtotal=a.base+extraSeats*a.extraRate; return {extraSeats,subtotal,average:subtotal/a.seats}; } }"... |
cmssjuu6l00zujmp2hc62ihz7 | Submission 62IHZ7 | {
"sample_query": "{ networkUsable(prefix: 24, reserved: 5) { addresses usable percentage } }",
"resolver_code": "Query: { networkUsable: (_, a) => { const addresses=2**(32-a.prefix),usable=Math.max(0,addresses-2-a.reserved); return {addresses,usable,percentage:usable/addresses*100}; } }",
"expected_response": "{... |
cmssjuu6l00zvjmp2vu2l1kjq | Submission 2L1KJQ | {
"sample_query": "{ alertState(value: 72, warn: 70, critical: 90, previousCritical: true) { state escalated recovered } }",
"resolver_code": "Query: { alertState: (_, a) => { const state=a.value>=a.critical?'critical':a.value>=a.warn?'warning':'ok'; return {state,escalated:state==='critical'&&!a.previousCritical,r... |
cmssjuu6l00zwjmp2u702e3zr | Submission 02E3ZR | {
"sample_query": "{ buildMatrix(platforms: 3, versions: 4, excluded: 2, parallel: 5) { jobs waves utilization } }",
"resolver_code": "Query: { buildMatrix: (_, a) => { const jobs=Math.max(0,a.platforms*a.versions-a.excluded),waves=Math.ceil(jobs/a.parallel); return {jobs,waves,utilization:jobs/(waves*a.parallel)};... |
cmssk2kku010hjmp2qmlq3z7a | Submission LQ3Z7A | {
"sample_query": "mutation { reserve(productId: \"p1\", quantity: 8) { quantity product { name stock } } }",
"resolver_code": "Query: {\n product: (_, { id }) => {\n const products = [{ id: \"p1\", name: \"Widget\", stock: 5 }];\n return products.find(p => p.id === id);\n }\n},\nMutation: {\n reserve: (_,... |
cmssk2kku010ijmp2knt4e47p | Submission T4E47P | {
"sample_query": "{ book(id: \"b1\") { title author { name } } }",
"resolver_code": "Query: {\n book: (_, { id }) => {\n const books = [{ id: \"b1\", title: \"Earthsea\", authorId: \"missing-author\" }];\n return books.find(b => b.id === id);\n }\n},\nBook: {\n author: (book) => {\n const authors = { a... |
cmssk2kku010jjmp2ans1syjr | Submission S1SYJR | {
"sample_query": "{ orders(status: \"shipped\", limit: 2, offset: 1) { id customer total } }",
"resolver_code": "Query: {\n orders: (_, { status, limit = 10, offset = 0 }) => {\n const allOrders = [\n { id: \"o1\", customer: \"Ann\", total: 42.5, status: \"shipped\" },\n { id: \"o2\", customer: \"Ben... |
cmssknsup0129jmp2jecnzp4g | Submission CNZP4G | {
"sample_query": "{ order(id: \"1\") { id total item { sku quantity } } }",
"resolver_code": "Query: {\n order: (_, { id }) => {\n if (id !== \"1\") throw new Error(\"order not found\");\n return { id, total: null, item: { sku: \"SKU-9\", quantity: 3 } };\n }\n}",
"expected_response": "{\"errors\":[{\"me... |
cmssknsuq012cjmp2oop4blw5 | Submission P4BLW5 | {
"sample_query": "{ ticketsByPriority { id priority } }",
"resolver_code": "Query: {\n ticketsByPriority: (_, { min }) => {\n const rank = { LOW: 0, MEDIUM: 1, HIGH: 2 };\n const all = [\n { id: \"1\", priority: \"LOW\" },\n { id: \"2\", priority: \"MEDIUM\" },\n { id: \"3\", priority: \"HIGH... |
cmssknsuq012djmp2phj8ecl1 | Submission J8ECL1 | {
"sample_query": "{ items { sku price } storeName }",
"resolver_code": "Query: {\n items: () => ([\n { sku: \"A1\", price: 5.5 },\n { sku: \"A2\", price: null },\n { sku: \"A3\", price: 7.25 }\n ]),\n storeName: () => \"Riverside Market\"\n}",
"expected_response": "{\"errors\":[{\"message\":\"Cannot ... |
cmssknsuq012ejmp2psbj1yc2 | Submission BJ1YC2 | {
"sample_query": "mutation { createUser(input: { name: \"Rae\", age: 16, address: { street: \"1 Main St\", zip: \"10001\" } }) { name age zip } }",
"resolver_code": "Mutation: {\n createUser: (_, { input }) => {\n if (input.age < 18) throw new Error(\"age must be at least 18\");\n return { name: input.name,... |
cmssknsuq012fjmp2ph30zwlm | Submission 30ZWLM | {
"sample_query": "{ comments(first: 2, after: 2) { id text } }",
"resolver_code": "Query: {\n comments: (_, { first, after }) => {\n const all = [\n { id: \"c1\", text: \"First!\" },\n { id: \"c2\", text: \"Nice post\" },\n { id: \"c3\", text: \"Agreed\" },\n { id: \"c4\", text: \"Thanks\" ... |
cmssknsuq012gjmp2dbxmg7qh | Submission XMG7QH | {
"sample_query": "{ a: square(n: 4) b: square(n: 9) c: square(n: 0) }",
"resolver_code": "Query: {\n square: (_, { n }) => n * n\n}",
"expected_response": "{\"data\":{\"a\":16,\"b\":81,\"c\":0}}",
"schema_definition": "type Query { square(n: Int!): Int! }"
} |
cmssknsuq012hjmp2ym96a1ga | Submission 96A1GA | {
"sample_query": "{ employee(id: \"3\") { name manager { name manager { name manager { name } } } } }",
"resolver_code": "Query: {\n employee: (_, { id }) => {\n const db = {\n \"3\": { id: \"3\", name: \"Priya\", managerId: \"2\" },\n \"2\": { id: \"2\", name: \"Owen\", managerId: \"1\" },\n \"... |
cmssknsuq012ijmp2vsq57x8h | Submission Q57X8H | {
"sample_query": "{ book { title pages author } }",
"resolver_code": "Query: {\n book: () => ({ title: \"The Pragmatic Programmer\", pages: 352, author: \"Hunt & Thomas\" })\n}",
"expected_response": "{\"data\":{\"book\":{\"title\":\"The Pragmatic Programmer\",\"pages\":352,\"author\":\"Hunt & Thomas\"}}}",
"... |
cmssknsuq012jjmp2jv8j6yny | Submission 8J6YNY | {
"sample_query": "{ weather(city: \"Paris\") time(zone: \"UTC\") }",
"resolver_code": "Query: {\n weather: (_, { city }) => {\n const known = { \"Hyderabad\": \"Hot and humid\", \"Tokyo\": \"Mild and clear\" };\n if (!known[city]) throw new Error(\"no data for city: \" + city);\n return known[city];\n }... |
cmsskpkyl012tjmp2ll81erf0 | Submission 81ERF0 | {
"sample_query": "{\n booksByGenre(genre: MYSTERY) {\n title\n rating\n author {\n name\n bookCount\n }\n }\n}",
"resolver_code": "Query: {\n booksByGenre: (_, { genre }) => {\n const books = [\n { id: \"b1\", title: \"Shadows of Kalte\", genre: \"MYSTERY\", rating: 4.5, authorId: ... |
cmsskpkym012ujmp29t46tqq9 | Submission 46TQQ9 | {
"sample_query": "mutation {\n createUser(username: \"al\", age: 25) {\n id\n username\n age\n }\n}",
"resolver_code": "Query: {\n ping: () => \"pong\"\n},\nMutation: {\n createUser: (_, { username, age }) => {\n if (age < 18) {\n throw new Error(\"age must be at least 18\");\n }\n if (u... |
cmsskpkym012wjmp2xf7gbmx9 | Submission 7GBMX9 | {
"sample_query": "{\n itemsAfter(cursor: \"9\") {\n id\n name\n }\n}",
"resolver_code": "Query: {\n itemsAfter: (_, { cursor }) => {\n const items = [\n { id: \"1\", name: \"Alpha\" },\n { id: \"2\", name: \"Beta\" },\n { id: \"3\", name: \"Gamma\" }\n ];\n const index = items.find... |
cmsskpkym012xjmp2eb3i66on | Submission 3I66ON | {
"sample_query": "{\n employees(department: \"Engineering\", limit: 2) {\n name\n salary\n }\n}",
"resolver_code": "Query: {\n employees: (_, { department, sort, limit }) => {\n const employees = [\n { id: \"e1\", name: \"Priya Nair\", department: \"Engineering\", salary: 95000 },\n { id: \"e... |
cmssl5c0x0157jmp2yv6yc98u | Submission 6YC98U | {
"sample_query": "{ booksByAuthor(author: \"Frank Herbert\") { title year } }",
"resolver_code": "Query: {\n book: (_, {id}) => {\n const books = [\n {id: \"1\", title: \"Dune\", author: \"Frank Herbert\", year: 1965},\n {id: \"2\", title: \"Foundation\", author: \"Isaac Asimov\", year: 1951}... |
cmssl5c0x0158jmp2mmo0yd1y | Submission O0YD1Y | {
"sample_query": "{ safeDivide(a: 10, b: 0) }",
"resolver_code": "Query: {\n safeDivide: (_, {a, b}) => {\n if (b === 0) throw new Error('cannot divide by zero');\n return a / b;\n }\n }",
"expected_response": "{\"errors\": [{\"message\": \"cannot divide by zero\"}]}",
"schema_definition": "ty... |
cmssl5c0x0159jmp2zdk2x5m3 | Submission K2X5M3 | {
"sample_query": "{ employeesByDepartment(department: \"Engineering\") { name salary } totalPayroll }",
"resolver_code": "Query: {\n employeesByDepartment: (_, {department}) => {\n const employees = [\n {id: \"1\", name: \"Alice\", department: \"Engineering\", salary: 95000},\n {id: \"2\", na... |
cmssl5c0x015ajmp2opkhmb26 | Submission KHMB26 | {
"sample_query": "{ customer(id: \"c1\") { name orders { status total } } }",
"resolver_code": "Query: {\n customer: (_, {id}) => {\n const customers = [{id: \"c1\", name: \"Dana\"}];\n return customers.find(c => c.id === id);\n },\n },\n Customer: {\n orders: (customer) => {\n const orde... |
cmssllqc0016yjmp2tic5mx5h | Submission C5MX5H | {
"sample_query": "{ team(slug: \"core\") { name lead { handle email } } }",
"resolver_code": "Query: { team: (_, { slug }) => ({ name: slug === 'core' ? 'Core Platform' : 'Unknown', slug }) },\nTeam: { lead: (team) => team.slug === 'core' ? { handle: 'nils' } : null },\nMember: { email: (m) => { if (!m.contactOk) ... |
cmssllqc1016zjmp2zyxgu8ur | Submission XGU8UR | {
"sample_query": "{ items(sort: PRICE_DESC, max: 30.5) { sku price } }",
"resolver_code": "Query: { items: (_, { sort, max }) => { const all = [{ sku: 'B-2', price: 30.5 }, { sku: 'A-1', price: 12.0 }, { sku: 'C-3', price: 30.5 }, { sku: 'D-4', price: 99.0 }]; const kept = max == null ? all : all.filter(i => i.pri... |
cmssllqc10170jmp2bt2202iw | Submission 2202IW | {
"sample_query": "{ report { title rows { label value } } }",
"resolver_code": "Query: { report: () => ({ title: 'Q3', rows: [{ label: 'ok', value: 1 }, { label: 'bad' }] }) },\nRow: { value: (row) => { if (row.value === undefined) throw new Error('missing value for ' + row.label); return row.value; } }",
"expec... |
cmssllqc10171jmp213sm58vo | Submission SM58VO | {
"sample_query": "{ people(filter: { city: \"Pune\", minAge: 30 }) { name age } }",
"resolver_code": "Query: { people: (_, { filter }) => { const rows = [{ name: 'Ines', age: 41, city: 'Lisbon' }, { name: 'Raj', age: 29, city: 'Pune' }, { name: 'Mei', age: 35, city: 'Pune' }]; const f = filter || {}; return rows.f... |
cmsslww490190jmp2xdz5hmys | Submission Z5HMYS | {
"sample_query": "{\n post(id: \"p1\") {\n title\n author { name }\n comments {\n text\n author { name }\n }\n }\n}",
"resolver_code": "Query: {\n post: (_, { id }) => {\n const posts = [\n { id: \"p1\", title: \"GraphQL Basics\", body: \"An intro to GraphQL.\", authorId: \"a1\" },... |
cmsslww490191jmp22wckxowr | Submission CKXOWR | {
"sample_query": "{ posts(status: PUBLISHED) { title status } }",
"resolver_code": "Query: {\n posts: (_, { status }) => {\n const posts = [\n { id: \"1\", title: \"Draft One\", status: \"DRAFT\" },\n { id: \"2\", title: \"Live Post\", status: \"PUBLISHED\" },\n { id: \"3\", title: \"Another Liv... |
cmsslww490192jmp2n703jjjy | Submission 03JJJY | {
"sample_query": "{ products(category: \"Home\", inStock: true) { name price } }",
"resolver_code": "Query: {\n products: (_, { category, inStock }) => {\n const products = [\n { id: \"1\", name: \"Widget\", category: \"Tools\", price: 9.99, inStock: true },\n { id: \"2\", name: \"Gadget\", category:... |
cmsslww490193jmp29adf1dej | Submission DF1DEJ | {
"sample_query": "mutation {\n placeOrder(productId: \"prod1\", quantity: 2) {\n order {\n id\n total\n lines {\n quantity\n product { name price }\n }\n }\n }\n}",
"resolver_code": "Mutation: {\n placeOrder: (_, { productId, quantity }) => {\n const products = [\n ... |
cmsslww490194jmp2dhbprsox | Submission BPRSOX | {
"sample_query": "mutation {\n buyItem(itemId: \"sku2\", qty: 5) {\n purchase { id grandTotal }\n }\n}",
"resolver_code": "Mutation: {\n buyItem: (_, { itemId, qty }) => {\n const items = [\n { id: \"sku1\", title: \"Notebook\", unitPrice: 3.5, quantityAvailable: 5 },\n { id: \"sku2\", title: \"... |
cmsslww490195jmp2tt3vdxp1 | Submission 3VDXP1 | {
"sample_query": "{ products(offset: 1, limit: 2) { name price } }",
"resolver_code": "Query: {\n products: (_, { offset, limit }) => {\n const products = [\n { id: \"1\", name: \"Alpha\", price: 5.0 },\n { id: \"2\", name: \"Beta\", price: 8.5 },\n { id: \"3\", name: \"Gamma\", price: 12.0 },\n... |
cmsslww4a0198jmp258g9r3mx | Submission G9R3MX | {
"sample_query": "{\n comments(postId: \"post1\", first: 2, after: \"c1\") {\n edges { cursor node { text } }\n pageInfo { hasNextPage endCursor }\n }\n}",
"resolver_code": "Query: {\n comments: (_, { postId, first, after }) => {\n const allComments = [\n { id: \"c1\", postId: \"post1\", text: \"F... |
cmsslww4a0199jmp2zh5g4dw8 | Submission 5G4DW8 | {
"sample_query": "mutation {\n updateTaskStatus(taskId: \"t2\", newStatus: IN_PROGRESS) {\n id\n status\n }\n}",
"resolver_code": "Mutation: {\n updateTaskStatus: (_, { taskId, newStatus }) => {\n const tasks = [\n { id: \"t1\", title: \"Write docs\", status: \"TODO\" },\n { id: \"t2\", title... |
cmsslww4a019ajmp2a0slq1eb | Submission SLQ1EB | {
"sample_query": "{\n project(id: \"proj1\") {\n name\n tasks(assigneeId: \"u1\") {\n title\n assignee { name }\n }\n }\n}",
"resolver_code": "Query: {\n project: (_, { id }) => {\n const projects = [ { id: \"proj1\", name: \"Website Revamp\" } ];\n return projects.find(p => p.id === id... |
cmsslww4a019bjmp24wi1mve5 | Submission I1MVE5 | {
"sample_query": "{\n author(id: \"a1\") {\n name\n bookCount\n books {\n title\n authors { name }\n }\n }\n}",
"resolver_code": "Query: {\n author: (_, { id }) => {\n const authors = [ { id: \"a1\", name: \"J. Rowe\" }, { id: \"a2\", name: \"K. Stone\" } ];\n return authors.find(a =... |
cmsslww4a019cjmp2faxulixx | Submission XULIXX | {
"sample_query": "mutation {\n checkoutBook(bookId: \"b2\") {\n title\n checkedOut\n dueDate\n }\n}",
"resolver_code": "Mutation: {\n checkoutBook: (_, { bookId }) => {\n const books = [\n { id: \"b1\", title: \"The Long Path\", checkedOut: false, dueDate: null },\n { id: \"b2\", title: \"... |
cmsslww4a019djmp28mzlngw2 | Submission ZLNGW2 | {
"sample_query": "mutation {\n sendMessage(channelId: \"ch1\", senderId: \"u2\", text: \"Good morning\") {\n message {\n text\n sender { username }\n }\n channel {\n name\n messages { text }\n }\n }\n}",
"resolver_code": "Query: {\n channel: (_, { id }) => {\n const channels =... |
cmsslww4a019ejmp2qfp4qq6m | Submission P4QQ6M | {
"sample_query": "{ profile(userId: \"u9\") { displayName bio } }",
"resolver_code": "Query: {\n profile: (_, { userId }) => {\n const profiles = [\n { id: \"u1\", displayName: \"Kai Nomura\", bio: \"Loves climbing\" },\n { id: \"u2\", displayName: \"Reese Okoye\", bio: null }\n ];\n const prof... |
cmsslww4a019gjmp25x6u886i | Submission 6U886I | {
"sample_query": "mutation { requestRide(pickupZone: \"midtown\") { id driver { name } } }",
"resolver_code": "Mutation: {\n requestRide: (_, { pickupZone }) => {\n const drivers = [\n { id: \"d1\", name: \"Femi\", available: true, zone: \"downtown\" },\n { id: \"d2\", name: \"Lola\", available: fals... |
cmsslww4a019hjmp2kcvr2cnn | Submission VR2CNN | {
"sample_query": "mutation {\n transferFunds(fromId: \"acc2\", toId: \"acc1\", amount: 75.0) {\n from { owner balance }\n to { owner balance }\n }\n}",
"resolver_code": "Mutation: {\n transferFunds: (_, { fromId, toId, amount }) => {\n const accounts = [ { id: \"acc1\", owner: \"Dana\", balance: 150.0 ... |
cmsslww4a019ijmp2g2zyqe4w | Submission ZYQE4W | {
"sample_query": "{\n device(id: \"dev1\") {\n name\n lastSeen\n sensors {\n type\n readings(minValue: 20) { timestamp value }\n }\n }\n}",
"resolver_code": "Query: {\n device: (_, { id }) => {\n const devices = [\n { id: \"dev1\", name: \"Greenhouse Node\", lastSeen: \"2026-08-14T... |
cmsslww4a019jjmp2rxgp698s | Submission GP698S | {
"sample_query": "{\n recipes(tag: \"vegan\") {\n title\n totalCalories\n ingredients { name calories }\n }\n}",
"resolver_code": "Query: {\n recipes: (_, { tag }) => {\n const recipes = [\n { id: \"r1\", title: \"Veggie Stir Fry\", tags: [\"vegan\", \"quick\"] },\n { id: \"r2\", title: \"... |
cmssm5nqf01bxjmp2u4p8jhi2 | Submission P8JHI2 | {
"sample_query": "{ books { title year } }",
"resolver_code": "Query: { books: (_, {minYear}) => [{id: \"1\", title: \"Neuromancer\", year: 1984}, {id: \"2\", title: \"Snow Crash\", year: 1992}, {id: \"3\", title: \"Ready Player One\", year: 2011}].filter(b => b.year >= minYear) }",
"expected_response": "{\"data... |
cmssm5nqf01byjmp2ub5p1h8o | Submission 5P1H8O | {
"sample_query": "{ squareRoot(n: -4) }",
"resolver_code": "Query: { squareRoot: (_, {n}) => { if (n < 0) throw new Error('cannot take square root of negative number'); return Math.sqrt(n); } }",
"expected_response": "{\"errors\": [{\"message\": \"cannot take square root of negative number\"}]}",
"schema_defin... |
cmssm5nqf01bzjmp252j0g8qn | Submission J0G8QN | {
"sample_query": "{ booksByAuthor(name: \"Frank Herbert\") { title author { name } } }",
"resolver_code": "Query: {\n booksByAuthor: (_, {name}) => {\n const books = [\n {title: \"Dune\", authorName: \"Frank Herbert\"},\n {title: \"Dune Messiah\", authorName: \"Frank Herbert\"},\n {title: \"Foun... |
cmssm5nqf01c0jmp2omrkqvk1 | Submission RKQVK1 | {
"sample_query": "{ tasksByStatus(status: ACTIVE) { id status } }",
"resolver_code": "Query: {\n tasksByStatus: (_, {status}) => {\n const tasks = [\n {id: \"1\", status: \"ACTIVE\"},\n {id: \"2\", status: \"PENDING\"},\n {id: \"3\", status: \"ACTIVE\"}\n ];\n return tasks.filter(t => t.st... |
cmssm5nqf01c1jmp27hmtxn4n | Submission MTXN4N | {
"sample_query": "{ user(id: \"2\") { name profile { bio } } }",
"resolver_code": "Query: {\n user: (_, {id}) => {\n const users = { \"1\": {id: \"1\", name: \"Grace\", profile: {bio: \"Computer scientist\"}}, \"2\": {id: \"2\", name: \"Alan\", profile: null} };\n return users[id] || null;\n }\n}",
"expe... |
cmssqhjyy004gg4p2bo5x6do4 | Submission 5X6DO4 | {
"sample_query": "{ account(id: \"2\") { id label } }",
"resolver_code": "Query: { account: (_, {id}) => ({ id, label: id === '2' ? null : 'Main ' + id }) }",
"expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Account.label.\"}],\"data\":{\"account\":null}}",
"schema_de... |
cmssqhjyy004hg4p2r2icbj6u | Submission ICBJ6U | {
"sample_query": "{ items { name weight } }",
"resolver_code": "Query: { items: () => [{name: 'a', weight: 1}, {name: 'b', weight: 2}] },\nItem: { weight: (item) => { if (item.name === 'b') throw new Error('weight unavailable for b'); return item.weight; } }",
"expected_response": "{\"errors\":[{\"message\":\"we... |
cmssqhjyy004ig4p2n1shrydn | Submission SHRYDN | {
"sample_query": "{ regions { code capital { name population } } }",
"resolver_code": "Query: { regions: () => [{code: 'nw', capital: {name: 'Alpha', population: 120}}, {code: 'se', capital: {name: 'Beta'}}] },\nCity: { population: (city) => city.population === undefined ? null : city.population }",
"expected_re... |
cmssqhjyy004jg4p2xs4addno | Submission 4ADDNO | {
"sample_query": "{ stage(step: 3) }",
"resolver_code": "Query: { stage: (_, {step}) => ['DRAFT','REVIEW','LIVE','ARCHIVED'][step] }",
"expected_response": "{\"errors\":[{\"message\":\"Enum \\\"Stage\\\" cannot represent value: \\\"ARCHIVED\\\"\"}],\"data\":null}",
"schema_definition": "enum Stage { DRAFT REVI... |
cmssqhjyy004kg4p2wbvudyv3 | Submission VUDYV3 | {
"sample_query": "{ slice(items: [\"a\",\"b\",\"c\",\"d\"]) }",
"resolver_code": "Query: { slice: (_, {items, limit}) => items.slice(0, limit) }",
"expected_response": "{\"data\":{\"slice\":[\"a\",\"b\"]}}",
"schema_definition": "type Query { slice(items: [String!]!, limit: Int = 2): [String!]! }"
} |
cmssqhjyy004lg4p2c2ifwwe8 | Submission IFWWE8 | {
"sample_query": "query { invoice { id net: subtotal { ...M } vat: tax { ...M } } } fragment M on Money { amount currency }",
"resolver_code": "Query: { invoice: () => ({id: 'inv-9', subtotal: {amount: 1000, currency: 'USD'}, tax: {amount: 85, currency: 'USD'}}) }",
"expected_response": "{\"data\":{\"invoice\":{... |
cmssqhjyy004mg4p2o5zawn55 | Submission ZAWN55 | {
"sample_query": "{ ratio(a: 7, b: 2) }",
"resolver_code": "Query: { ratio: (_, {a, b}) => a / b }",
"expected_response": "{\"errors\":[{\"message\":\"Int cannot represent non-integer value: 3.5\"}],\"data\":null}",
"schema_definition": "type Query { ratio(a: Int!, b: Int!): Int! }"
} |
cmssqhjyy004ng4p261xvgopd | Submission XVGOPD | {
"sample_query": "mutation { addUser(input: {name: \"Ida\", age: -1}) { name age } }",
"resolver_code": "Query: { _empty: () => null },\nMutation: { addUser: (_, {input}) => { if (input.age < 0) throw new Error('age must be non-negative'); return input; } }",
"expected_response": "{\"errors\":[{\"message\":\"age... |
cmssqhjyy004og4p28c2yx4w2 | Submission 2YX4W2 | {
"sample_query": "{ report { id summary @include(if: true) detail @skip(if: true) } }",
"resolver_code": "Query: { report: () => ({id: 'r1', summary: 'short', detail: 'long form text'}) }",
"expected_response": "{\"data\":{\"report\":{\"id\":\"r1\",\"summary\":\"short\"}}}",
"schema_definition": "type Report {... |
cmssqhjyy004pg4p25by95anl | Submission Y95ANL | {
"sample_query": "{ matches(filters: [{field: \"a\", minValue: 3}, {field: \"b\", minValue: \"x\"}]) { field score } }",
"resolver_code": "Query: { matches: (_, {filters}) => filters.map(f => ({field: f.field, score: f.minValue * 10})) }",
"expected_response": "{\"errors\":[{\"message\":\"Int cannot represent no... |
cmssqhjyy004qg4p2ncpen9t4 | Submission PEN9T4 | {
"sample_query": "{ category { name parent { name parent { name parent { name } } } } }",
"resolver_code": "Query: { category: () => ({name: 'leaf', parent: {name: 'mid', parent: {name: 'root', parent: null}}}) }",
"expected_response": "{\"data\":{\"category\":{\"name\":\"leaf\",\"parent\":{\"name\":\"mid\",\"pa... |
cmssqhjyy004rg4p2i8edtym4 | Submission EDTYM4 | {
"sample_query": "{ slowSum(values: [1,2,3]) }",
"resolver_code": "Query: { slowSum: async (_, {values}) => { const parts = await Promise.all(values.map(async v => v * 2)); return parts.reduce((a, b) => a + b, 0); } }",
"expected_response": "{\"data\":{\"slowSum\":12}}",
"schema_definition": "type Query { slow... |
cmssqhjyy004sg4p25lsj2z2c | Submission SJ2Z2C | {
"sample_query": "{ rows { id } }",
"resolver_code": "Query: { rows: () => null }",
"expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Query.rows.\"}],\"data\":null}",
"schema_definition": "type Row { id: ID! }\ntype Query { rows: [Row!]! }"
} |
cmssqhjyy004tg4p2xjn4u6vq | Submission N4U6VQ | {
"sample_query": "{ order { id total lines { sku lineTotal } } }",
"resolver_code": "Query: { order: () => ({id: 'o1', lines: [{sku: 'A', qty: 2, unitPrice: 300}, {sku: 'B', qty: 1, unitPrice: 450}]}) },\nLine: { lineTotal: (line) => line.qty * line.unitPrice },\nOrder: { total: (order) => order.lines.reduce((sum,... |
cmssqhjyy004ug4p2a3vvp80u | Submission VVP80U | {
"sample_query": "{ profile { handle email } }",
"resolver_code": "Query: { profile: () => ({handle: 'bravebooby'}) }",
"expected_response": "{\"errors\":[{\"message\":\"Cannot query field \\\"email\\\" on type \\\"Profile\\\".\"}]}",
"schema_definition": "type Profile { handle: String! }\ntype Query { profile... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.