submissionId
stringlengths
25
25
title
stringlengths
17
64
payload
dict
cmsvgn37g01r5g4p2j66exlh6
Submission 6EXLH6
{ "sample_query": "{ items(category: \"furniture\", onlyInStock: true) { name inStock } }", "resolver_code": "Query: {\n items: (_, {category, onlyInStock}) => {\n const all = [\n { name: \"Chair\", category: \"furniture\", inStock: true },\n { name: \"Table\", category: \"furniture\", inStock: false ...
cmsvgn37g01r6g4p2mkwojiwj
Submission WOJIWJ
{ "sample_query": "{ company(id: \"2\") { name ceo { name } } }", "resolver_code": "Query: {\n company: (_, {id}) => {\n const db = { \"1\": { name: \"Acme\", ceo: { name: \"Jane\" } }, \"2\": { name: \"Startup\", ceo: null } };\n return db[id];\n }\n}", "expected_response": "{\"data\": {\"company\": {\"n...
cmsvgn37g01r7g4p2cj8wb64g
Submission 8WB64G
{ "sample_query": "{ filterEven(nums: [1, 2, 3, 4, 5, 6, 7, 8]) }", "resolver_code": "Query: {\n filterEven: (_, {nums}) => nums.filter(n => n % 2 === 0)\n}", "expected_response": "{\"data\": {\"filterEven\": [2, 4, 6, 8]}}", "schema_definition": "type Query { filterEven(nums: [Int!]!): [Int!]! }" }
cmsvgn37g01r8g4p2y71mkvwv
Submission 1MKVWV
{ "sample_query": "{ weightedAverage(scores: [80, 90, 70], weights: [0.5, 0.3, 0.2]) }", "resolver_code": "Query: {\n weightedAverage: (_, {scores, weights}) => {\n let sum = 0, wsum = 0;\n for (let i = 0; i < scores.length; i++) {\n sum += scores[i] * weights[i];\n wsum += weights[i];\n }\n ...
cmsvhfvmf01u4g4p2h6ok6l8z
Submission OK6L8Z
{ "sample_query": "{ cart { id items { id price qty } total } }", "resolver_code": "Query: {\n cart: () => ({\n id: \"c1\",\n items: [\n { id: \"i1\", price: 10, qty: 2 },\n { id: \"i2\", price: 5, qty: 3 }\n ]\n })\n},\nCart: {\n total: (parent) => parent.items.r...
cmsvhfvmf01u5g4p2vf957uqy
Submission 957UQY
{ "sample_query": "{ order { id subtotal tax } }", "resolver_code": "Query: {\n order: () => ({ id: \"1\", subtotal: 100 })\n},\nOrder: {\n tax: (parent) => Math.round(parent.subtotal * 0.08)\n}", "expected_response": "{\"data\": {\"order\": {\"id\": \"1\", \"subtotal\": 100, \"tax\": 8}}}", "schema_defin...
cmsvhfvmf01u6g4p2oymlvid4
Submission MLVID4
{ "sample_query": "{ itemsByStatus(status: DELETED) }", "resolver_code": "Query: {\n itemsByStatus: (_, { status }) => status === \"ACTIVE\" ? 5 : 0\n}", "expected_response": "{\"errors\": [{\"message\": \"Value \\\"DELETED\\\" does not exist in \\\"Status\\\" enum.\", \"locations\": [{\"line\": 1, \"column\":...
cmsvhfvmf01u7g4p2imavfb9e
Submission AVFB9E
{ "sample_query": "{ scores }", "resolver_code": "Query: {\n scores: () => [10, 20, null, 40]\n}", "expected_response": "{\"errors\": [{\"message\": \"Cannot return null for non-nullable field Query.scores.\", \"locations\": [{\"line\": 1, \"column\": 3}], \"path\": [\"scores\", 2]}]}", "schema_definition": ...
cmsvhfvmf01u8g4p2pym1bu57
Submission M1BU57
{ "sample_query": "{ outer { inner { value } } }", "resolver_code": "Query: {\n outer: () => ({ inner: null })\n}", "expected_response": "{\"errors\": [{\"message\": \"Cannot return null for non-nullable field Outer.inner.\", \"locations\": [{\"line\": 1, \"column\": 11}], \"path\": [\"outer\", \"inner\"]}]}",...
cmsvhfvmf01u9g4p239erlc76
Submission ERLC76
{ "sample_query": "mutation { createUser(email: \"not-an-email\") { id email } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n createUser: (_, { email }) => {\n if (!email.includes(\"@\")) {\n throw new Error(\"Invalid email format\");\n }\n return { id: \"99...
cmsvhfvmf01uag4p2bxct4s34
Submission CT4S34
{ "sample_query": "{ describe(person: { name: \"Alice\", address: { city: \"Springfield\", zip: \"00000\" } }) }", "resolver_code": "Query: {\n describe: (_, { person }) => `${person.name} lives in ${person.address.city} ${person.address.zip}`\n}", "expected_response": "{\"data\": {\"describe\": \"Alice lives ...
cmsvhfvmf01ubg4p22g337qe1
Submission 337QE1
{ "sample_query": "{ cartTotal(prices: [10, 20, 30]) }", "resolver_code": "Query: { cartTotal: (_, { prices, taxRate }) => { const sum = prices.reduce((a,b) => a+b, 0); return Math.round(sum * (1+taxRate) * 100) / 100; } }", "expected_response": "{\"data\": {\"cartTotal\": 64.8}}", "schema_definition": "type Qu...
cmsvhfvmf01ucg4p2key0vwyh
Submission Y0VWYH
{ "sample_query": "{ first: user(id: \"1\") { name } second: user(id: \"2\") { name } }", "resolver_code": "Query: {\n user: (_, { id }) => ({ id, name: id === \"1\" ? \"Alice\" : \"Bob\" })\n}", "expected_response": "{\"data\": {\"first\": {\"name\": \"Alice\"}, \"second\": {\"name\": \"Bob\"}}}", "schema_d...
cmsvhfvmf01udg4p275vd9esd
Submission VD9ESD
{ "sample_query": "{ checkStock(itemId: \"sku-99\") }", "resolver_code": "Query: { checkStock: (_, { itemId }) => { const inventory = { \"sku-1\": 42, \"sku-2\": 0 }; if (!(itemId in inventory)) throw new Error(\"unknown item: \" + itemId); return inventory[itemId]; } }", "expected_response": "{\"errors\":[{\"mes...
cmsvhg9z001ueg4p2bapde33a
Submission PDE33A
{ "sample_query": "{ head { value next { value next { value next { value } } } } }", "resolver_code": "Query: {\n head: () => {\n const n3 = { value: 3, next: null };\n const n2 = { value: 2, next: n3 };\n const n1 = { value: 1, next: n2 };\n return n1;\n }\n}", "expected_respons...
cmsvhg9z001ufg4p2hdh17rso
Submission H17RSO
{ "sample_query": "{ escalate(current: MEDIUM) }", "resolver_code": "Query: {\n escalate: (_, { current }) => {\n const order = [\"LOW\", \"MEDIUM\", \"HIGH\"];\n const idx = order.indexOf(current);\n return order[Math.min(idx + 1, order.length - 1)];\n }\n}", "expected_response": "{\"d...
cmsvhg9z001ugg4p238vfqz3e
Submission VFQZ3E
{ "sample_query": "{ tags categories }", "resolver_code": "Query: {\n tags: () => null,\n categories: () => []\n}", "expected_response": "{\"data\": {\"tags\": null, \"categories\": []}}", "schema_definition": "type Query { tags: [String!], categories: [String!]! }" }
cmsvhg9z001uhg4p2rcu14mfd
Submission U14MFD
{ "sample_query": "{ products(minPrice: 10) { name price } }", "resolver_code": "Query: {\n products: (_, { minPrice }) => [\n { id: \"1\", price: 10, name: \"Widget\" },\n { id: \"2\", price: 50, name: \"Gadget\" },\n { id: \"3\", price: 5, name: \"Gizmo\" }\n ].filter(p => p.price >= mi...
cmsvhg9z001uig4p2j1m8g91w
Submission M8G91W
{ "sample_query": "{ me { ...UserFields } } fragment UserFields on User { id name email }", "resolver_code": "Query: {\n me: () => ({ id: \"1\", name: \"Alice\", email: \"alice@example.com\" })\n}", "expected_response": "{\"data\": {\"me\": {\"id\": \"1\", \"name\": \"Alice\", \"email\": \"alice@example.com\"}...
cmsvhg9z001ujg4p27mzuf3ds
Submission ZUF3DS
{ "sample_query": "{ lookup(id: 42) }", "resolver_code": "Query: {\n lookup: (_, { id }) => `looked up id=${id} (type ${typeof id})`\n}", "expected_response": "{\"data\": {\"lookup\": \"looked up id=42 (type string)\"}}", "schema_definition": "type Query { lookup(id: ID!): String! }" }
cmsvhg9z001ukg4p2k47rsrlc
Submission 7RSRLC
{ "sample_query": "{ name secret @include(if: false) }", "resolver_code": "Query: {\n name: () => \"public\",\n secret: () => \"hidden\"\n}", "expected_response": "{\"data\": {\"name\": \"public\"}}", "schema_definition": "type Query { name: String!, secret: String! }" }
cmsvhg9z001ulg4p2kb24faea
Submission 24FAEA
{ "sample_query": "{ start { id b { id c { id a { id } } } } }", "resolver_code": "Query: { start: () => {\n const aRec = { id: \"a1\" };\n const bRec = { id: \"b1\" };\n const cRec = { id: \"c1\" };\n aRec.b = bRec;\n bRec.c = cRec;\n cRec.a = aRec;\n return aRec;\n} },\nA: { b: (a) => a.b },\...
cmsvhg9z001umg4p2wf9r4mm1
Submission 9R4MM1
{ "sample_query": "{ multiply(a: 5) }", "resolver_code": "Query: {\n multiply: (_, { a, b }) => a * b\n}", "expected_response": "{\"data\": {\"multiply\": 10}}", "schema_definition": "type Query { multiply(a: Int!, b: Int = 2): Int! }" }
cmsvhg9z001ung4p2jxzbntuo
Submission ZBNTUO
{ "sample_query": "{ roundedCount }", "resolver_code": "Query: {\n roundedCount: () => 7.0\n}", "expected_response": "{\"data\": {\"roundedCount\": 7}}", "schema_definition": "type Query { roundedCount: Int! }" }
cmsvmh0a001wqg4p2kymqjhkb
Submission MQJHKB
{ "sample_query": "{ product { id price discountedPrice } }", "resolver_code": "Query: {\n product: () => ({ id: \"1\", price: 100.0 })\n},\nProduct: {\n discountedPrice: (p) => Math.round(p.price * 0.8 * 100) / 100\n}", "expected_response": "{\"data\": {\"product\": {\"id\": \"1\", \"price\": 100, \"discou...
cmsvmh0a001wrg4p2tkaw4in5
Submission AW4IN5
{ "sample_query": "{ users { name } }", "resolver_code": "Query: {\n users: (_, { onlyActive }) => [\n { id: \"1\", name: \"Alice\", active: true },\n { id: \"2\", name: \"Bob\", active: false },\n { id: \"3\", name: \"Carol\", active: true }\n ].filter(u => !onlyActive || u.active)\n}", ...
cmsvmh0a001wsg4p2i8eeqpab
Submission EEQPAB
{ "sample_query": "{ categorize(celsius: 30) }", "resolver_code": "Query: {\n categorize: (_, { celsius }) => {\n if (celsius < 10) return \"COLD\";\n if (celsius < 25) return \"MILD\";\n return \"HOT\";\n }\n}", "expected_response": "{\"data\": {\"categorize\": \"HOT\"}}", "schema_de...
cmsvmh0a001wtg4p2ra9wptyf
Submission 9WPTYF
{ "sample_query": "{ stats { count total average } }", "resolver_code": "Query: {\n stats: () => {\n const values = [10, 20, 30, 40];\n return { values };\n }\n},\nStats: {\n count: (s) => s.values.length,\n total: (s) => s.values.reduce((a, b) => a + b, 0),\n average: (s) => s.values.r...
cmsvmh0a001wug4p2uqkwrbjr
Submission KWRBJR
{ "sample_query": "{ id optionalNote }", "resolver_code": "Query: {\n id: () => \"abc123\",\n optionalNote: () => null\n}", "expected_response": "{\"data\": {\"id\": \"abc123\", \"optionalNote\": null}}", "schema_definition": "type Query { id: ID!, optionalNote: String }" }
cmsvmh0a001wvg4p2rqu6o8jh
Submission U6O8JH
{ "sample_query": "{ scores }", "resolver_code": "Query: {\n scores: () => [10, null, 30, null]\n}", "expected_response": "{\"data\": {\"scores\": [10, null, 30, null]}}", "schema_definition": "type Query { scores: [Int] }" }
cmsvmh0a001wwg4p24gi91oo7
Submission I91OO7
{ "sample_query": "mutation { increment(by: 3) { value } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n increment: (_, { by }) => ({ value: 5 + by })\n}", "expected_response": "{\"data\": {\"increment\": {\"value\": 8}}}", "schema_definition": "type Counter { value: Int! }\ntype Mutati...
cmsvmh0a001wxg4p2udagzpd4
Submission AGZPD4
{ "sample_query": "{ shout(text: \"hello\") }", "resolver_code": "Query: {\n shout: (_, { text }) => text.toUpperCase() + \"!\"\n}", "expected_response": "{\"data\": {\"shout\": \"HELLO!\"}}", "schema_definition": "type Query { shout(text: String!): String! }" }
cmsvmh0a001wyg4p2w7yu2638
Submission YU2638
{ "sample_query": "{ sumList(nums: [1, 2, 3, 4, 5]) }", "resolver_code": "Query: {\n sumList: (_, { nums }) => nums.reduce((a, b) => a + b, 0)\n}", "expected_response": "{\"data\": {\"sumList\": 15}}", "schema_definition": "type Query { sumList(nums: [Int!]!): Int! }" }
cmsvmh0a001wzg4p2gxrdjgp8
Submission RDJGP8
{ "sample_query": "{ level1 { level2 { level3 { value } } } }", "resolver_code": "Query: {\n level1: () => ({ level2: { level3: { value: 99 } } })\n}", "expected_response": "{\"data\": {\"level1\": {\"level2\": {\"level3\": {\"value\": 99}}}}}", "schema_definition": "type Level3 { value: Int! }\ntype Level2 ...
cmsvml76s01y4g4p2ry02d24y
Submission 02D24Y
{ "sample_query": "{ safeName riskyDivide(a: 10, b: 0) }", "resolver_code": "Query: {\n safeName: () => \"server1\",\n riskyDivide: (_, { a, b }) => {\n if (b === 0) throw new Error(\"division by zero\");\n return a / b;\n }\n}", "expected_response": "{\"errors\": [{\"message\": \"division ...
cmsvml76s01y5g4p2zioa1d8s
Submission OA1D8S
{ "sample_query": "{ items { id lineTotal } }", "resolver_code": "Query: {\n items: () => [\n { id: \"1\", price: 5, qty: 3 },\n { id: \"2\", price: 10, qty: 2 }\n ]\n},\nItem: {\n lineTotal: (i) => i.price * i.qty\n}", "expected_response": "{\"data\": {\"items\": [{\"id\": \"1\", \"lineTot...
cmsvml76s01y6g4p2klq0dfrv
Submission Q0DFRV
{ "sample_query": "{ status(verbose: true) }", "resolver_code": "Query: {\n status: (_, { verbose }) => verbose ? \"System operational, all checks passed\" : \"OK\"\n}", "expected_response": "{\"data\": {\"status\": \"System operational, all checks passed\"}}", "schema_definition": "type Query { status(verbo...
cmsvml76s01y7g4p2z9agvw9a
Submission AGVW9A
{ "sample_query": "{ user { id name } }", "resolver_code": "Query: {\n user: () => ({ id: \"1\", name: \"Dave\", secretInternalField: \"hidden\" })\n}", "expected_response": "{\"data\": {\"user\": {\"id\": \"1\", \"name\": \"Dave\"}}}", "schema_definition": "type User { id: ID!, name: String! }\ntype Query {...
cmsvml76s01y8g4p2jze3hshd
Submission E3HSHD
{ "sample_query": "{ celsiusToFahrenheit(values: [0, 100, 37]) }", "resolver_code": "Query: { celsiusToFahrenheit: (_, { values }) => values.map(c => Math.round((c * 9/5 + 32) * 100) / 100) }", "expected_response": "{\"data\": {\"celsiusToFahrenheit\": [32, 212, 98.6]}}", "schema_definition": "type Query { cels...
cmsvml76s01y9g4p2mf2pfhcg
Submission 2PFHCG
{ "sample_query": "{ percentage(part: 3, total: 8) }", "resolver_code": "Query: {\n percentage: (_, { part, total }) => Math.round((part / total) * 10000) / 100\n}", "expected_response": "{\"data\": {\"percentage\": 37.5}}", "schema_definition": "type Query { percentage(part: Int!, total: Int!): Float! }" }
cmsvml76s01yag4p23o7rtu32
Submission 7RTU32
{ "sample_query": "mutation { compute(a: 4, b: 6) { sum product } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n compute: (_, { a, b }) => ({ sum: a + b, product: a * b })\n}", "expected_response": "{\"data\": {\"compute\": {\"sum\": 10, \"product\": 24}}}", "schema_definition": "type ...
cmsvml76s01ybg4p28wppfexa
Submission PPFEXA
{ "sample_query": "{ bmi(body: { weightKg: 70, heightM: 1.75 }) }", "resolver_code": "Query: {\n bmi: (_, { body }) => Math.round((body.weightKg / (body.heightM * body.heightM)) * 10) / 10\n}", "expected_response": "{\"data\": {\"bmi\": 22.9}}", "schema_definition": "input BodyInput { weightKg: Float!, heigh...
cmsvml76s01ycg4p2dx1ef0cu
Submission 1EF0CU
{ "sample_query": "{ root { value children { value children { value } } } }", "resolver_code": "Query: {\n root: () => ({\n value: 1,\n children: [\n { value: 2, children: [{ value: 4, children: [] }] },\n { value: 3, children: [] }\n ]\n })\n}", "expected_response...
cmsvml76s01ydg4p245xnp1ti
Submission XNP1TI
{ "sample_query": "{ tags }", "resolver_code": "Query: {\n tags: () => []\n}", "expected_response": "{\"data\": {\"tags\": []}}", "schema_definition": "type Query { tags: [String!]! }" }
cmsvmljy501yeg4p2f2kgtaua
Submission KGTAUA
{ "sample_query": "{ x: cube(n: 2) y: cube(n: 4) }", "resolver_code": "Query: {\n cube: (_, { n }) => n * n * n\n}", "expected_response": "{\"data\": {\"x\": 8, \"y\": 64}}", "schema_definition": "type Query { cube(n: Int!): Int! }" }
cmsvnjd76020ng4p28lz40glx
Submission Z40GLX
{ "sample_query": "mutation { applyDiscount(code: \"SAVE20\", subtotal: 150) }", "resolver_code": "Mutation: { applyDiscount: (_, { code, subtotal }) => { const discounts = { SAVE10: 0.1, SAVE20: 0.2 }; const rate = discounts[code] || 0; return Math.round(subtotal * (1 - rate) * 100) / 100; } }", "expected_respon...
cmsvnjd76020og4p2e8tytt0t
Submission TYTT0T
{ "sample_query": "{ overtimePay(baseRate: 20, hoursWorked: 46) }", "resolver_code": "Query: { overtimePay: (_, { baseRate, hoursWorked }) => { const regular = Math.min(hoursWorked, 40); const overtime = Math.max(hoursWorked - 40, 0); return baseRate * regular + baseRate * 1.5 * overtime; } }", "expected_response...
cmsvnjd76020pg4p2sebnsxz3
Submission BNSXZ3
{ "sample_query": "{ fruits(color: \"red\") { name } }", "resolver_code": "Query: {\n fruits: (_, { color }) => [\n { name: \"apple\", color: \"red\" },\n { name: \"banana\", color: \"yellow\" },\n { name: \"cherry\", color: \"red\" }\n ].filter(f => f.color === color)\n}", "expected_re...
cmsvnjd76020qg4p2j2pp9vw9
Submission PP9VW9
{ "sample_query": "mutation { addTag(tag: \"new\") }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n addTag: (_, { tag }) => [\"existing\", \"tags\", tag]\n}", "expected_response": "{\"data\": {\"addTag\": [\"existing\", \"tags\", \"new\"]}}", "schema_definition": "type Mutation { addTag(...
cmsvnjd76020rg4p2fankmidd
Submission NKMIDD
{ "sample_query": "{ account(id: \"99\") { id balance } }", "resolver_code": "Query: {\n account: (_, { id }) => {\n const accounts = { \"1\": { id: \"1\", balance: 100 } };\n return accounts[id] || null;\n }\n}", "expected_response": "{\"data\": {\"account\": null}}", "schema_definition": "...
cmsvnjd76020sg4p24dwd61ni
Submission WD61NI
{ "sample_query": "{ orders(status: SHIPPED) { id } }", "resolver_code": "Query: {\n orders: (_, { status }) => [\n { id: \"1\", status: \"PENDING\" },\n { id: \"2\", status: \"SHIPPED\" },\n { id: \"3\", status: \"SHIPPED\" }\n ].filter(o => o.status === status)\n}", "expected_response...
cmsvnjd76020tg4p2x3bfkm1s
Submission BFKM1S
{ "sample_query": "{ student { name average } }", "resolver_code": "Query: { student: () => ({ name: \"Sam\", grades: [80, 90, 70, 100] }) },\nStudent: {\n average: (s) => s.grades.reduce((a, b) => a + b, 0) / s.grades.length\n}", "expected_response": "{\"data\": {\"student\": {\"name\": \"Sam\", \"average\": ...
cmsvnjd76020ug4p2uodmarqw
Submission DMARQW
{ "sample_query": "mutation { createCustomer(name: \"Lee\", city: \"Austin\", zip: \"78701\") { name address { city zip } } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n createCustomer: (_, { name, city, zip }) => ({ name, address: { city, zip } })\n}", "expected_response": "{\"data\": ...
cmsvnjd76020vg4p242j5ce5j
Submission J5CE5J
{ "sample_query": "{ wordLength(word: \"graphql\") }", "resolver_code": "Query: {\n wordLength: (_, { word }) => word.length\n}", "expected_response": "{\"data\": {\"wordLength\": 7}}", "schema_definition": "type Query { wordLength(word: String!): Int! }" }
cmsvnjd76020wg4p2df5h1kjn
Submission 5H1KJN
{ "sample_query": "{ info(n: 7) { value isEven } }", "resolver_code": "Query: { info: (_, { n }) => ({ value: n }) },\nNumberInfo: {\n isEven: (i) => i.value % 2 === 0\n}", "expected_response": "{\"data\": {\"info\": {\"value\": 7, \"isEven\": false}}}", "schema_definition": "type NumberInfo { value: Int!, i...
cmsvnjd76020xg4p28n4b8xgz
Submission 4B8XGZ
{ "sample_query": "{ cart { total } }", "resolver_code": "Query: { cart: () => ({ orders: [{ id: \"1\", amount: 20 }, { id: \"2\", amount: 35 }] }) },\nCart: {\n total: (c) => c.orders.reduce((sum, o) => sum + o.amount, 0)\n}", "expected_response": "{\"data\": {\"cart\": {\"total\": 55}}}", "schema_definitio...
cmsvnjd76020yg4p2v6lgyy82
Submission LGYY82
{ "sample_query": "{ fullAddress(street: \"1 Main St\", city: \"Springfield\", zip: \"62704\") }", "resolver_code": "Query: {\n fullAddress: (_, { street, city, zip }) => `${street}, ${city} ${zip}`\n}", "expected_response": "{\"data\": {\"fullAddress\": \"1 Main St, Springfield 62704\"}}", "schema_definitio...
cmsvnjd76020zg4p2eop4o547
Submission P4O547
{ "sample_query": "{ milesToKm(miles: 26.2) }", "resolver_code": "Query: {\n milesToKm: (_, { miles }) => Math.round(miles * 1.60934 * 100) / 100\n}", "expected_response": "{\"data\": {\"milesToKm\": 42.16}}", "schema_definition": "type Query { milesToKm(miles: Float!): Float! }" }
cmsvnjd760210g4p2sq0j5gpv
Submission 0J5GPV
{ "sample_query": "{ head { value next { value next { value next { value } } } } }", "resolver_code": "Query: {\n head: () => ({\n value: 1,\n next: { value: 2, next: { value: 3, next: null } }\n })\n}", "expected_response": "{\"data\": {\"head\": {\"value\": 1, \"next\": {\"value\": 2, \"next...
cmsvnjd760211g4p2455nrkfn
Submission 5NRKFN
{ "sample_query": "{ squareRoot(n: -4) }", "resolver_code": "Query: {\n squareRoot: (_, { n }) => {\n if (n < 0) throw new Error(\"cannot compute square root of negative number\");\n return Math.sqrt(n);\n }\n}", "expected_response": "{\"errors\": [{\"message\": \"cannot compute square root of...
cmsvnjd760212g4p233dxe3x2
Submission DXE3X2
{ "sample_query": "{ maxOf(nums: [3, 9, 1, 7, 4]) }", "resolver_code": "Query: {\n maxOf: (_, { nums }) => Math.max(...nums)\n}", "expected_response": "{\"data\": {\"maxOf\": 9}}", "schema_definition": "type Query { maxOf(nums: [Int!]!): Int! }" }
cmsvnjd760213g4p2jofxpltr
Submission FXPLTR
{ "sample_query": "{ discountCode(eligible: false) }", "resolver_code": "Query: {\n discountCode: (_, { eligible }) => eligible ? \"SAVE10\" : null\n}", "expected_response": "{\"data\": {\"discountCode\": null}}", "schema_definition": "type Query { discountCode(eligible: Boolean!): String }" }
cmsvnjd760214g4p2145t7vwr
Submission 5T7VWR
{ "sample_query": "{ standard: priceWithTax(price: 100, taxRate: 0.08) premium: priceWithTax(price: 200, taxRate: 0.08) }", "resolver_code": "Query: {\n priceWithTax: (_, { price, taxRate }) => Math.round(price * (1 + taxRate) * 100) / 100\n}", "expected_response": "{\"data\": {\"standard\": 108, \"premium\": ...
cmsvnjd760215g4p2mnt4hi7q
Submission T4HI7Q
{ "sample_query": "{ orderTotal(order: { items: [10, 20, 30] }) }", "resolver_code": "Query: {\n orderTotal: (_, { order }) => order.items.reduce((a, b) => a + b, 0)\n}", "expected_response": "{\"data\": {\"orderTotal\": 60}}", "schema_definition": "input OrderInput { items: [Int!]! }\ntype Query { orderTota...
cmsvnjd760216g4p2os53vd9s
Submission 53VD9S
{ "sample_query": "{ tagCount }", "resolver_code": "Query: {\n tagCount: (_, { tags }) => tags.length\n}", "expected_response": "{\"data\": {\"tagCount\": 2}}", "schema_definition": "type Query { tagCount(tags: [String!] = [\"default\", \"sample\"]): Int! }" }
cmsvnjqxf0217g4p29fsamaqg
Submission SAMAQG
{ "sample_query": "{ warehouse(threshold: 50) { name stock lowStock } }", "resolver_code": "Query: { warehouse: (_, { threshold }) => ({ name: \"Central\", stock: 42, threshold }) },\nWarehouse: {\n lowStock: (w) => w.stock < w.threshold\n}", "expected_response": "{\"data\": {\"warehouse\": {\"name\": \"Centra...
cmsvnwdlk023gg4p2tiupnkoe
Submission UPNKOE
{ "sample_query": "{ package(weightKg: 4.4) { weightKg shippingCost } }", "resolver_code": "Query: { package: (_, { weightKg }) => ({ weightKg }) },\nPackage: {\n shippingCost: (p) => Math.round(p.weightKg * 2.5 * 100) / 100\n}", "expected_response": "{\"data\": {\"package\": {\"weightKg\": 4.4, \"shippingCost...
cmsvnwdlk023hg4p21dy73v3h
Submission Y73V3H
{ "sample_query": "{ articles(limit: 2) { id title } }", "resolver_code": "Query: {\n articles: (_, { limit }) => [\n { id: \"1\", title: \"First\" },\n { id: \"2\", title: \"Second\" },\n { id: \"3\", title: \"Third\" },\n { id: \"4\", title: \"Fourth\" }\n ].slice(0, limit)\n}", ...
cmsvnwdlk023ig4p22la39936
Submission A39936
{ "sample_query": "{ product { name reviews { rating comment } } }", "resolver_code": "Query: {\n product: () => ({\n name: \"Widget\",\n reviews: [\n { rating: 5, comment: \"Great\" },\n { rating: 2, comment: \"Meh\" },\n { rating: 4, comment: \"Good\" }\n ]...
cmsvnwdlk023jg4p23921k3dm
Submission 21K3DM
{ "sample_query": "mutation { deleteItem(id: \"5\") }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n deleteItem: (_, { id }) => {\n const existing = new Set([\"1\", \"2\", \"3\"]);\n return existing.has(id);\n }\n}", "expected_response": "{\"data\": {\"deleteItem\": false}...
cmsvnwdlk023kg4p2pts2ebly
Submission S2EBLY
{ "sample_query": "{ person { name age } }", "resolver_code": "Query: { person: () => ({ name: \"Sam\", birthYear: 1990 }) },\nPerson: {\n age: (p) => 2026 - p.birthYear\n}", "expected_response": "{\"data\": {\"person\": {\"name\": \"Sam\", \"age\": 36}}}", "schema_definition": "type Person { name: String!, ...
cmsvnwdlk023lg4p2gnw92as4
Submission W92AS4
{ "sample_query": "{ pageSize }", "resolver_code": "Query: {\n pageSize: (_, { size }) => size\n}", "expected_response": "{\"data\": {\"pageSize\": 10}}", "schema_definition": "type Query { pageSize(size: Int = 10): Int! }" }
cmsvnwdlk023mg4p2ck2gs009
Submission 2GS009
{ "sample_query": "{ order(quantity: 12, unitPrice: 2.5) { quantity unitPrice subtotal discountApplied total } }", "resolver_code": "Query: {\n order: (_, { quantity, unitPrice }) => ({ quantity, unitPrice })\n},\nOrder: {\n subtotal: (parent) => parent.quantity * parent.unitPrice,\n discountApplied: (parent) =>...
cmsvnwdlk023ng4p2op2mxm12
Submission 2MXM12
{ "sample_query": "mutation { withdraw(currentBalance: 100, amount: 150) { balance currency } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n withdraw: (_, { currentBalance, amount }) => {\n if (amount <= 0) throw new Error(\"withdrawal amount must be positive\");\n if (amount > current...
cmsvnwdlk023og4p2dg4i4d39
Submission 4I4D39
{ "sample_query": "{ doubleAll(nums: [1, 2, 3, 4]) }", "resolver_code": "Query: {\n doubleAll: (_, { nums }) => nums.map(n => n * 2)\n}", "expected_response": "{\"data\": {\"doubleAll\": [2, 4, 6, 8]}}", "schema_definition": "type Query { doubleAll(nums: [Int!]!): [Int!]! }" }
cmsvnwdlk023pg4p2fexxzr1c
Submission XXZR1C
{ "sample_query": "{ joinWords(words: [\"red\", \"green\", \"blue\"], separator: \" | \") }", "resolver_code": "Query: {\n joinWords: (_, { words, separator }) => words.join(separator)\n}", "expected_response": "{\"data\": {\"joinWords\": \"red | green | blue\"}}", "schema_definition": "type Query { joinWord...
cmsvnwdlk023qg4p20wbmi307
Submission BMI307
{ "sample_query": "{ author { initials } }", "resolver_code": "Query: { author: () => ({ firstName: \"Grace\", lastName: \"Hopper\" }) },\nAuthor: {\n initials: (a) => `${a.firstName[0]}${a.lastName[0]}`\n}", "expected_response": "{\"data\": {\"author\": {\"initials\": \"GH\"}}}", "schema_definition": "type ...
cmsvnwdlk023rg4p2qwzcph72
Submission ZCPH72
{ "sample_query": "{ bothTrue(a: true, b: false) }", "resolver_code": "Query: {\n bothTrue: (_, { a, b }) => a && b\n}", "expected_response": "{\"data\": {\"bothTrue\": false}}", "schema_definition": "type Query { bothTrue(a: Boolean!, b: Boolean!): Boolean! }" }
cmsvnwdlk023sg4p2b4kka1sp
Submission KKA1SP
{ "sample_query": "{ rect { label area } }", "resolver_code": "Query: { rect: () => ({ width: 4, height: 5, label: \"Box A\" }) },\nRectangle: {\n area: (r) => r.width * r.height\n}", "expected_response": "{\"data\": {\"rect\": {\"label\": \"Box A\", \"area\": 20}}}", "schema_definition": "type Rectangle { w...
cmsvnwdlk023tg4p2jtiojlw3
Submission IOJLW3
{ "sample_query": "mutation { toggleFeature(current: true) }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n toggleFeature: (_, { current }) => !current\n}", "expected_response": "{\"data\": {\"toggleFeature\": false}}", "schema_definition": "type Mutation { toggleFeature(current: Boolean...
cmsvnwdlk023ug4p2qsn5ftb4
Submission N5FTB4
{ "sample_query": "{ average(nums: [2.5, 3.5, 4.0]) }", "resolver_code": "Query: {\n average: (_, { nums }) => Math.round((nums.reduce((a, b) => a + b, 0) / nums.length) * 100) / 100\n}", "expected_response": "{\"data\": {\"average\": 3.33}}", "schema_definition": "type Query { average(nums: [Float!]!): Floa...
cmsvnwdlk023vg4p2xxl55auy
Submission L55AUY
{ "sample_query": "{ account(type: \"gold\") { type isPremium } }", "resolver_code": "Query: { account: (_, { type }) => ({ type }) },\nAccount: {\n isPremium: (a) => a.type === \"gold\" || a.type === \"platinum\"\n}", "expected_response": "{\"data\": {\"account\": {\"type\": \"gold\", \"isPremium\": true}}}",...
cmsvnwdlk023wg4p2pvd4puqw
Submission D4PUQW
{ "sample_query": "{ factorial(n: 6) }", "resolver_code": "Query: {\n factorial: (_, { n }) => {\n function fact(x) { return x <= 1 ? 1 : x * fact(x - 1); }\n return fact(n);\n }\n}", "expected_response": "{\"data\": {\"factorial\": 720}}", "schema_definition": "type Query { factorial(n: Int...
cmsvnwdlk023xg4p2igotqu3f
Submission OTQU3F
{ "sample_query": "{ rectangle(width: 4, height: 5) { width height area } }", "resolver_code": "Query: {\n rectangle: (_, { width, height }) => ({ width, height })\n},\nRectangle: {\n area: (parent) => parent.width * parent.height\n}", "expected_response": "{\"data\":{\"rectangle\":{\"width\":4,\"height\":5,\"a...
cmsvnwdlk023yg4p22xg365yf
Submission G365YF
{ "sample_query": "{ reverseList(items: [\"a\", \"b\", \"c\", \"d\"]) }", "resolver_code": "Query: {\n reverseList: (_, { items }) => [...items].reverse()\n}", "expected_response": "{\"data\": {\"reverseList\": [\"d\", \"c\", \"b\", \"a\"]}}", "schema_definition": "type Query { reverseList(items: [String!]!)...
cmsvnwdlk023zg4p2kbbvwbod
Submission BVWBOD
{ "sample_query": "{ endpoint { fullUrl } }", "resolver_code": "Query: { endpoint: () => ({ protocol: \"https\", host: \"api.example.com\", path: \"/v1/users\" }) },\nEndpoint: {\n fullUrl: (e) => `${e.protocol}://${e.host}${e.path}`\n}", "expected_response": "{\"data\": {\"endpoint\": {\"fullUrl\": \"https://...
cmsvocvnr027mg4p2gfrut8uy
Submission RUT8UY
{ "sample_query": "{ products(inStockOnly: true) { name inStock } }", "resolver_code": "Query: {\n products: (_, {inStockOnly}) => {\n const all = [\n {name: \"Widget\", inStock: true},\n {name: \"Gadget\", inStock: false},\n {name: \"Gizmo\", inStock: true}\n ];\n return inStockOnly ? all....
cmsvocvnr027og4p2t0i21b91
Submission I21B91
{ "sample_query": "{ author { name bookCount books { title } } }", "resolver_code": "Query: {\n author: () => ({name: \"Frank Herbert\", books: [{title: \"Dune\"}, {title: \"Dune Messiah\"}, {title: \"Children of Dune\"}]})\n},\nAuthor: {\n bookCount: (a) => a.books.length\n}", "expected_response": "{\"data\": ...
cmsvocvnr027qg4p267npdtz5
Submission NPDTZ5
{ "sample_query": "{ numbers(offset: 3, limit: 2) }", "resolver_code": "Query: {\n numbers: (_, {offset, limit}) => {\n const all = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];\n return all.slice(offset, offset + limit);\n }\n}", "expected_response": "{\"data\": {\"numbers\": [4, 5]}}", "schema_definition": "type Q...
cmsvocvns027rg4p2o1s87nub
Submission S87NUB
{ "sample_query": "{ tasks(minPriority: MEDIUM) { title priority } }", "resolver_code": "Query: {\n tasks: (_, {minPriority}) => {\n const order = {LOW: 0, MEDIUM: 1, HIGH: 2};\n const all = [\n {title: \"Clean desk\", priority: \"LOW\"},\n {title: \"Fix bug\", priority: \"HIGH\"},\n {title: \...
cmsvocvns027sg4p2ducnmkfw
Submission CNMKFW
{ "sample_query": "{ comments { text author } }", "resolver_code": "Query: {\n comments: () => ([\n {text: \"Great post!\", author: \"Alice\"},\n {text: \"Anonymous comment\", author: null}\n ])\n}", "expected_response": "{\"data\": {\"comments\": [{\"text\": \"Great post!\", \"author\": \"Alice\"}, {\"te...
cmsvocvns027tg4p20b24ny9g
Submission 24NY9G
{ "sample_query": "{ cart { items total } }", "resolver_code": "Query: {\n cart: () => ({items: [10, 20, 30]})\n},\nCart: {\n total: (c) => c.items.reduce((sum, x) => sum + x, 0)\n}", "expected_response": "{\"data\": {\"cart\": {\"items\": [10, 20, 30], \"total\": 60}}}", "schema_definition": "type Cart { ite...
cmsvocvns027vg4p2v8cprcbk
Submission CPRCBK
{ "sample_query": "{ shout(text: \"hello\") }", "resolver_code": "Query: { shout: (_, {text}) => text.toUpperCase() + '!' }", "expected_response": "{\"data\": {\"shout\": \"HELLO!\"}}", "schema_definition": "type Query { shout(text: String!): String! }" }
cmsvor0hk02b8g4p2rjqn1037
Submission QN1037
{ "sample_query": "{ item(basePrice: 80, percentOff: 25) { finalPrice } }", "resolver_code": "Query: { item: (_, { basePrice, percentOff }) => ({ basePrice, percentOff }) },\nItem: { finalPrice: (i) => Math.round(i.basePrice * (1 - i.percentOff / 100) * 100) / 100 }", "expected_response": "{\"data\": {\"item\": {...
cmsvor0hk02b9g4p25xtjteee
Submission TJTEEE
{ "sample_query": "mutation { increment(current: 10, step: 5) }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: { increment: (_, { current, step }) => current + step }", "expected_response": "{\"data\": {\"increment\": 15}}", "schema_definition": "type Mutation { increment(current: Int!, step: I...
cmsvor0hk02bag4p24ah8bpdn
Submission H8BPDN
{ "sample_query": "{ aboveThreshold(nums: [3, 8, 1, 12, 5], min: 5) }", "resolver_code": "Query: { aboveThreshold: (_, { nums, min }) => nums.filter(n => n >= min) }", "expected_response": "{\"data\": {\"aboveThreshold\": [8, 12, 5]}}", "schema_definition": "type Query { aboveThreshold(nums: [Int!]!, min: Int!)...
cmsvor0hk02bbg4p28o8nog3o
Submission 8NOG3O
{ "sample_query": "{ student { name passed } }", "resolver_code": "Query: { student: () => ({ name: \"Kim\", scores: [45, 72, 88, 30] }) },\nStudent: { passed: (s) => s.scores.map(sc => sc >= 50) }", "expected_response": "{\"data\": {\"student\": {\"name\": \"Kim\", \"passed\": [false, true, true, false]}}}", "...
cmsvor0hk02bcg4p2mn7aoj52
Submission 7AOJ52
{ "sample_query": "mutation { squareRoot(n: -9) }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n squareRoot: (_, { n }) => {\n if (n < 0) throw new Error(\"cannot take square root of negative number\");\n return Math.sqrt(n);\n }\n}", "expected_response": "{\"errors\": [{\...
cmsvor0hk02bdg4p2fnwf6fu9
Submission WF6FU9
{ "sample_query": "{ greetRole }", "resolver_code": "Query: { greetRole: (_, { role }) => `Welcome, ${role}!` }", "expected_response": "{\"data\": {\"greetRole\": \"Welcome, guest!\"}}", "schema_definition": "type Query { greetRole(role: String = \"guest\"): String! }" }
cmsvor0hk02beg4p2i80pa2l9
Submission 0PA2L9
{ "sample_query": "{ circle(radius: 5) { area circumference } }", "resolver_code": "Query: { circle: (_, { radius }) => ({ radius }) },\nCircle: {\n area: (c) => Math.round(Math.PI * c.radius * c.radius * 100) / 100,\n circumference: (c) => Math.round(2 * Math.PI * c.radius * 100) / 100\n}", "expected_respo...