submissionId
stringlengths
25
25
title
stringlengths
17
64
payload
dict
cmsvor0hk02bfg4p26n4ybsgi
Submission 4YBSGI
{ "sample_query": "{ post { title commentCount } }", "resolver_code": "Query: {\n post: () => ({\n title: \"Hello\",\n comments: [{ text: \"Nice!\" }, { text: \"Thanks\" }, { text: \"+1\" }]\n })\n},\nPost: { commentCount: (p) => p.comments.length }", "expected_response": "{\"data\": {\"post\"...
cmsvor0hk02bgg4p2ayvkywxt
Submission VKYWXT
{ "sample_query": "{ sortDesc(nums: [4, 1, 9, 3, 7]) }", "resolver_code": "Query: { sortDesc: (_, { nums }) => [...nums].sort((a, b) => b - a) }", "expected_response": "{\"data\": {\"sortDesc\": [9, 7, 4, 3, 1]}}", "schema_definition": "type Query { sortDesc(nums: [Int!]!): [Int!]! }" }
cmsvor0hk02bhg4p2wzz5ac03
Submission Z5AC03
{ "sample_query": "{ sameWord(a: \"Hello\", b: \"HELLO\") }", "resolver_code": "Query: { sameWord: (_, { a, b }) => a.toLowerCase() === b.toLowerCase() }", "expected_response": "{\"data\": {\"sameWord\": true}}", "schema_definition": "type Query { sameWord(a: String!, b: String!): Boolean! }" }
cmsvor0hk02big4p2fvpv2dtq
Submission PV2DTQ
{ "sample_query": "{ order { total } }", "resolver_code": "Query: {\n order: () => ({\n items: [\n { price: 9.99, qty: 3 },\n { price: 4.5, qty: 2 },\n { price: 20.0, qty: 1 }\n ]\n })\n},\nOrder: { total: (o) => Math.round(o.items.reduce((sum, i) => sum + i.pric...
cmsvor0hk02bjg4p2y2166z57
Submission 166Z57
{ "sample_query": "mutation { addTag(existing: [\"red\", \"blue\"], tag: \"green\") }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: { addTag: (_, { existing, tag }) => [...existing, tag].length }", "expected_response": "{\"data\": {\"addTag\": 3}}", "schema_definition": "type Mutation { addTag...
cmsvor0hk02bkg4p2aooh213n
Submission OH213N
{ "sample_query": "{ profile(username: \"newuser\") { username bio } }", "resolver_code": "Query: { profile: (_, { username }) => ({ username, bio: null }) }", "expected_response": "{\"data\": {\"profile\": {\"username\": \"newuser\", \"bio\": null}}}", "schema_definition": "type Profile { username: String!, bi...
cmsvor0hk02blg4p23h6gbj5m
Submission 6GBJ5M
{ "sample_query": "{ task(status: \"completed\") { status isDone } }", "resolver_code": "Query: { task: (_, { status }) => ({ status }) },\nTask: { isDone: (t) => t.status === \"completed\" || t.status === \"closed\" }", "expected_response": "{\"data\": {\"task\": {\"status\": \"completed\", \"isDone\": true}}}",...
cmsvor0hk02bmg4p2i5wr6e3a
Submission WR6E3A
{ "sample_query": "{ greetAll(names: [\"Ann\", \"Ben\"]) }", "resolver_code": "Query: { greetAll: (_, { names }) => names.map(n => `Hi, ${n}!`) }", "expected_response": "{\"data\": {\"greetAll\": [\"Hi, Ann!\", \"Hi, Ben!\"]}}", "schema_definition": "type Query { greetAll(names: [String!]!): [String!]! }" }
cmsvor0hk02bng4p2ly9pzp6u
Submission 9PZP6U
{ "sample_query": "{ fib(n: 10) }", "resolver_code": "Query: {\n fib: (_, { n }) => {\n function fibonacci(x) { return x <= 1 ? x : fibonacci(x - 1) + fibonacci(x - 2); }\n return fibonacci(n);\n }\n}", "expected_response": "{\"data\": {\"fib\": 55}}", "schema_definition": "type Query { fib(...
cmsvor0hk02bog4p2dj693nkr
Submission 693NKR
{ "sample_query": "mutation { makeRectangle(width: 6, height: 3) { area } }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: { makeRectangle: (_, { width, height }) => ({ width, height }) },\nRectangle: { area: (r) => r.width * r.height }", "expected_response": "{\"data\": {\"makeRectangle\": {\"ar...
cmsvor0hk02bpg4p22l93yoj2
Submission 93YOJ2
{ "sample_query": "{ distinctCount(items: [\"a\", \"b\", \"a\", \"c\", \"b\", \"a\"]) }", "resolver_code": "Query: { distinctCount: (_, { items }) => new Set(items).size }", "expected_response": "{\"data\": {\"distinctCount\": 3}}", "schema_definition": "type Query { distinctCount(items: [String!]!): Int! }" }
cmsvor0hk02bqg4p2xj339nzf
Submission 339NZF
{ "sample_query": "mutation { double(n: 21) negate(n: 7) }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n double: (_, { n }) => n * 2,\n negate: (_, { n }) => -n\n}", "expected_response": "{\"data\": {\"double\": 42, \"negate\": -7}}", "schema_definition": "type Mutation { double(n: I...
cmsvor0hk02brg4p2burn3p7w
Submission RN3P7W
{ "sample_query": "{ person { bmiCategory } }", "resolver_code": "Query: { person: () => ({ weightKg: 70, heightM: 1.75 }) },\nPerson: {\n bmiCategory: (p) => {\n const bmi = p.weightKg / (p.heightM * p.heightM);\n if (bmi < 18.5) return \"underweight\";\n if (bmi < 25) return \"normal\";\n ...
cmsvor0hk02bsg4p2tg82lsw1
Submission 82LSW1
{ "sample_query": "mutation { firstOf(items: []) }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n firstOf: (_, { items }) => {\n if (items.length === 0) throw new Error(\"items list cannot be empty\");\n return items[0];\n }\n}", "expected_response": "{\"errors\": [{\"mess...
cmsvor0hk02btg4p2d8wzng1g
Submission WZNG1G
{ "sample_query": "{ company { highEarnerCount } }", "resolver_code": "Query: {\n company: () => ({\n employees: [\n { name: \"A\", salary: 50000 },\n { name: \"B\", salary: 120000 },\n { name: \"C\", salary: 95000 },\n { name: \"D\", salary: 150000 }\n ]...
cmsvor0hk02bug4p2x57gxdq6
Submission 7GXDQ6
{ "sample_query": "{ priceWithTax(price: 100) }", "resolver_code": "Query: { priceWithTax: (_, { price, taxRate }) => Math.round(price * (1 + taxRate) * 100) / 100 }", "expected_response": "{\"data\": {\"priceWithTax\": 108}}", "schema_definition": "type Query { priceWithTax(price: Float!, taxRate: Float = 0.08...
cmsvor0hk02bvg4p2s5hruxxe
Submission HRUXXE
{ "sample_query": "{ stats(nums: [7, 2, 9, 4, 1]) { min max } }", "resolver_code": "Query: { stats: (_, { nums }) => ({ min: Math.min(...nums), max: Math.max(...nums) }) }", "expected_response": "{\"data\": {\"stats\": {\"min\": 1, \"max\": 9}}}", "schema_definition": "type Stats { min: Int!, max: Int! }\ntype ...
cmsvor0hk02bwg4p2gijof2v8
Submission JOF2V8
{ "sample_query": "{ splitWords(sentence: \"the quick brown fox\") }", "resolver_code": "Query: { splitWords: (_, { sentence }) => sentence.split(\" \") }", "expected_response": "{\"data\": {\"splitWords\": [\"the\", \"quick\", \"brown\", \"fox\"]}}", "schema_definition": "type Query { splitWords(sentence: Stri...
cmsvor0hk02bxg4p2gww1loec
Submission W1LOEC
{ "sample_query": "{ square { area } triangle { area } }", "resolver_code": "Query: {\n square: () => ({ side: 4 }),\n triangle: () => ({ base: 6, height: 3 })\n},\nSquare: { area: (s) => s.side * s.side },\nTriangle: { area: (t) => 0.5 * t.base * t.height }", "expected_response": "{\"data\": {\"square\": {...
cmsvor0hk02byg4p29ze7q8ao
Submission E7Q8AO
{ "sample_query": "mutation { createUsername(name: \"Al\") }", "resolver_code": "Query: { ping: () => \"pong\" },\nMutation: {\n createUsername: (_, { name }) => {\n if (name.length < 3) throw new Error(\"username must be at least 3 characters\");\n return name.toLowerCase();\n }\n}", "expecte...
cmsvor0hk02bzg4p2kzn1aaih
Submission N1AAIH
{ "sample_query": "{ report { weightedAverage } }", "resolver_code": "Query: {\n report: () => ({\n grades: [\n { score: 90, weight: 0.5 },\n { score: 80, weight: 0.3 },\n { score: 70, weight: 0.2 }\n ]\n })\n},\nReport: {\n weightedAverage: (r) => Math.round(...
cmsvor0hk02c0g4p2o9ewnlsh
Submission EWNLSH
{ "sample_query": "{ page(offset: 2, limit: 3) }", "resolver_code": "Query: {\n page: (_, { offset, limit }) => {\n const all = [10, 20, 30, 40, 50, 60, 70, 80];\n return all.slice(offset, offset + limit);\n }\n}", "expected_response": "{\"data\": {\"page\": [30, 40, 50]}}", "schema_definiti...
cmsvor0hk02c1g4p226x0a1rm
Submission X0A1RM
{ "sample_query": "{ cart(subtotal: 50) { label } }", "resolver_code": "Query: { cart: (_, { subtotal, couponPercent }) => ({ subtotal, couponPercent: couponPercent ?? null }) },\nCart: {\n label: (c) => c.couponPercent ? `${c.couponPercent}% off applied` : \"no discount\"\n}", "expected_response": "{\"data\":...
cmsvqtnc502sgg4p2v1hantza
Submission HANTZA
{ "sample_query": "{ itemsByWarehouse(warehouse: \"west\") { name quantity } }", "resolver_code": "Query: { itemsByWarehouse: (_, { warehouse }) => [\n { id: \"1\", name: \"Wrench\", quantity: 42, warehouse: \"west\" },\n { id: \"2\", name: \"Hammer\", quantity: 7, warehouse: \"east\" }\n].filter(i => i.warehouse...
cmsvrifbx02smg4p2ynr2no6a
Submission R2NO6A
{ "sample_query": "{ sensor { id celsius } }", "resolver_code": "Query: { sensor: () => ({id: 's1'}) }", "expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Sensor.celsius.\"}],\"data\":null}", "schema_definition": "type Sensor { id: ID!, celsius: Float! }\ntype Query { s...
cmsvrifby02sng4p2elzjihxd
Submission ZJIHXD
{ "sample_query": "{ crates { code mass } }", "resolver_code": "Query: { crates: () => [{code: 'A', mass: 3}, {code: 'B'}] }", "expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Crate.mass.\"}],\"data\":null}", "schema_definition": "type Crate { code: String!, mass: Int!...
cmsvrifby02sog4p228jyvk0b
Submission JYVK0B
{ "sample_query": "{ route { id legs { from to } } }", "resolver_code": "Query: { route: () => ({id: 'r1', legs: [{from: 'X', to: 'Y'}, {from: 'Y'}]}) }", "expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Leg.to.\"}],\"data\":{\"route\":null}}", "schema_definition": "ty...
cmsvrifby02spg4p20lyaowhf
Submission YAOWHF
{ "sample_query": "{ slots { hour taken } }", "resolver_code": "Query: { slots: () => [{hour: 9, taken: false}, null, {hour: 11, taken: true}] }", "expected_response": "{\"data\":{\"slots\":[{\"hour\":9,\"taken\":false},null,{\"hour\":11,\"taken\":true}]}}", "schema_definition": "type Slot { hour: Int!, taken: ...
cmsvrifby02sqg4p2qmdhgonu
Submission DHGONU
{ "sample_query": "{ withdraw(amount: 500, balance: 120) }", "resolver_code": "Query: { withdraw: (_, {amount, balance}) => { if (amount > balance) throw new Error('insufficient funds'); return balance - amount; } }", "expected_response": "{\"errors\":[{\"message\":\"insufficient funds\"}],\"data\":null}", "sch...
cmsvrifby02srg4p2rvqg5doh
Submission QG5DOH
{ "sample_query": "{ ok: parseAge(raw: \"42\") bad: parseAge(raw: \"4.5\") }", "resolver_code": "Query: { parseAge: (_, {raw}) => { const n = Number(raw); if (!Number.isInteger(n)) throw new Error('not an integer: ' + raw); return n; } }", "expected_response": "{\"errors\":[{\"message\":\"not an integer: 4.5\"}],...
cmsvrifby02ssg4p2gw5asnbt
Submission 5ASNBT
{ "sample_query": "{ doc(id: \"9\") { id body } }", "resolver_code": "Query: { doc: (_, {id}) => { if (id !== '1') throw new Error('document ' + id + ' not found'); return {id, body: 'hello'}; } }", "expected_response": "{\"errors\":[{\"message\":\"document 9 not found\"}],\"data\":null}", "schema_definition": ...
cmsvrifby02stg4p2px67wlci
Submission 67WLCI
{ "sample_query": "{ mean(total: 7, count: 2) }", "resolver_code": "Query: { mean: (_, {total, count}) => total / count }", "expected_response": "{\"errors\":[{\"message\":\"Int cannot represent non-integer value: 3.5\"}],\"data\":null}", "schema_definition": "type Query { mean(total: Int!, count: Int!): Int! }...
cmsvrifby02sug4p2elufbjl5
Submission UFBJL5
{ "sample_query": "{ whole: ratio(a: 6, b: 3) fractional: ratio(a: 7, b: 2) }", "resolver_code": "Query: { ratio: (_, {a, b}) => a / b }", "expected_response": "{\"data\":{\"whole\":2,\"fractional\":3.5}}", "schema_definition": "type Query { ratio(a: Int!, b: Int!): Float! }" }
cmsvrifby02svg4p2h4hn0w2f
Submission HN0W2F
{ "sample_query": "{ fromInt: label(id: 7) fromString: label(id: \"7\") }", "resolver_code": "Query: { label: (_, {id}) => typeof id + ':' + id }", "expected_response": "{\"data\":{\"fromInt\":\"string:7\",\"fromString\":\"string:7\"}}", "schema_definition": "type Query { label(id: ID!): String! }" }
cmsvrifby02swg4p25nzaxn6i
Submission ZAXN6I
{ "sample_query": "{ flag(on: true) }", "resolver_code": "Query: { flag: (_, {on}) => typeof on + ':' + on }", "expected_response": "{\"data\":{\"flag\":\"boolean:true\"}}", "schema_definition": "type Query { flag(on: Boolean!): String! }" }
cmsvrifby02sxg4p2jyui0a3g
Submission UI0A3G
{ "sample_query": "{ big(n: 1.5) }", "resolver_code": "Query: { big: (_, {n}) => n * 2 }", "expected_response": "{\"data\":{\"big\":3}}", "schema_definition": "type Query { big(n: Float!): Float! }" }
cmsvrifby02syg4p2y6undh2b
Submission UNDH2B
{ "sample_query": "{ level(n: 2) }", "resolver_code": "Query: { level: (_, {n}) => ['LOW', 'HIGH', 'CRITICAL'][n] }", "expected_response": "{\"errors\":[{\"message\":\"Enum \\\"Level\\\" cannot represent value: \\\"CRITICAL\\\"\"}],\"data\":null}", "schema_definition": "enum Level { LOW HIGH }\ntype Query { lev...
cmsvrifby02szg4p246qqr3vo
Submission QQR3VO
{ "sample_query": "{ ok: pick(s: HEARTS) bad: pick(s: CLUBS) }", "resolver_code": "Query: { pick: (_, {s}) => 'got ' + s }", "expected_response": "{\"errors\":[{\"message\":\"Value \\\"CLUBS\\\" does not exist in \\\"Suit\\\" enum.\"}]}", "schema_definition": "enum Suit { HEARTS SPADES }\ntype Query { pick(s: S...
cmsvrifby02t0g4p2m931e1si
Submission 31E1SI
{ "sample_query": "{ modes __type(name: \"Mode\") { enumValues { name } } }", "resolver_code": "Query: { modes: () => ['READ', 'WRITE'] }", "expected_response": "{\"data\":{\"modes\":[\"READ\",\"WRITE\"],\"__type\":{\"enumValues\":[{\"name\":\"READ\"},{\"name\":\"WRITE\"}]}}}", "schema_definition": "enum Mode {...
cmsvrifby02t1g4p2onla8tqq
Submission LA8TQQ
{ "sample_query": "{ dflt: page(items: [\"a\",\"b\",\"c\",\"d\",\"e\"]) explicit: page(items: [\"a\",\"b\",\"c\",\"d\",\"e\"], size: 1) }", "resolver_code": "Query: { page: (_, {items, size}) => items.slice(0, size) }", "expected_response": "{\"data\":{\"dflt\":[\"a\",\"b\",\"c\"],\"explicit\":[\"a\"]}}", "sche...
cmsvrifby02t2g4p26ziql8km
Submission IQL8KM
{ "sample_query": "{ span(r: {lo: 10, hi: 4}) }", "resolver_code": "Query: { span: (_, {r}) => { if (r.hi < r.lo) throw new Error('hi must not be below lo'); return r.hi - r.lo; } }", "expected_response": "{\"errors\":[{\"message\":\"hi must not be below lo\"}],\"data\":null}", "schema_definition": "input Range...
cmsvrifby02t3g4p2xcuutkyb
Submission UUTKYB
{ "sample_query": "{ rank(tags: [{key: \"a\", weight: 1}, {key: \"b\", weight: 5}]) { key score } }", "resolver_code": "Query: { rank: (_, {tags}) => tags.map(t => ({key: t.key, score: t.weight * 2})).sort((a, b) => b.score - a.score) }", "expected_response": "{\"data\":{\"rank\":[{\"key\":\"b\",\"score\":10},{\"...
cmsvrifby02t4g4p251jzkt3r
Submission JZKT3R
{ "sample_query": "{ count(f: [{field: \"a\", min: 1}, {field: \"b\", min: \"oops\"}]) }", "resolver_code": "Query: { count: (_, {f}) => f.length }", "expected_response": "{\"errors\":[{\"message\":\"Int cannot represent non-integer value: \\\"oops\\\"\"}]}", "schema_definition": "input Filter { field: String!,...
cmsvrifby02t6g4p2vvdz0f0o
Submission DZ0F0O
{ "sample_query": "query { bill { a: net { ...M } b: vat { ...M } c: total { ...M } } } fragment M on Money { cents currency }", "resolver_code": "Query: { bill: () => ({net: {cents: 1000, currency: 'GBP'}, vat: {cents: 200, currency: 'GBP'}, total: {cents: 1200, currency: 'GBP'}}) }", "expected_response": "{\"da...
cmsvrifby02t7g4p2npi9p4hl
Submission I9P4HL
{ "sample_query": "query { head { ...N next { ...N next { ...N next { ...N } } } } } fragment N on Node3 { name }", "resolver_code": "Query: { head: () => ({name: 'a', next: {name: 'b', next: {name: 'c', next: null}}}) }", "expected_response": "{\"data\":{\"head\":{\"name\":\"a\",\"next\":{\"name\":\"b\",\"next\"...
cmsvrifby02t8g4p26uhpw6cc
Submission HPW6CC
{ "sample_query": "{ panel { id brief @include(if: true) verbose @include(if: false) } }", "resolver_code": "Query: { panel: () => ({id: 'p', brief: 'short', verbose: 'long'}) }", "expected_response": "{\"data\":{\"panel\":{\"id\":\"p\",\"brief\":\"short\"}}}", "schema_definition": "type Panel { id: ID!, brief:...
cmsvrifby02t9g4p2vwiazm9a
Submission IAZM9A
{ "sample_query": "{ row { a b @skip(if: true) c @skip(if: false) } }", "resolver_code": "Query: { row: () => ({a: 1, b: 2, c: 3}) }", "expected_response": "{\"data\":{\"row\":{\"a\":1,\"c\":3}}}", "schema_definition": "type Row { a: Int!, b: Int!, c: Int! }\ntype Query { row: Row! }" }
cmsvrifby02tag4p2q80nsfuf
Submission 0NSFUF
{ "sample_query": "{ cart { grand lines { qty total } } }", "resolver_code": "Query: { cart: () => ({lines: [{qty: 2, unit: 50}, {qty: 3, unit: 10}]}) },\nLine: { total: (l) => l.qty * l.unit },\nCart: { grand: (c) => c.lines.reduce((s, l) => s + l.qty * l.unit, 0) }", "expected_response": "{\"data\":{\"cart\":{\...
cmsvrifby02tbg4p2fwlnihps
Submission LNIHPS
{ "sample_query": "{ words { text length upper } }", "resolver_code": "Query: { words: () => [{text: 'alpha'}, {text: 'be'}] },\nWord: { length: (w) => w.text.length, upper: (w) => w.text.toUpperCase() }", "expected_response": "{\"data\":{\"words\":[{\"text\":\"alpha\",\"length\":5,\"upper\":\"ALPHA\"},{\"text\":...
cmsvrifby02tcg4p298mejk9u
Submission MEJK9U
{ "sample_query": "{ stat { values sum max } }", "resolver_code": "Query: { stat: () => ({values: [4, 9, 2]}) },\nStat: { sum: (s) => s.values.reduce((a, b) => a + b, 0), max: (s) => Math.max(...s.values) }", "expected_response": "{\"data\":{\"stat\":{\"values\":[4,9,2],\"sum\":15,\"max\":9}}}", "schema_definit...
cmsvrifby02tdg4p2pbk924gx
Submission K924GX
{ "sample_query": "{ bag { all: count withA: count(prefix: \"a\") } }", "resolver_code": "Query: { bag: () => ({items: ['ant', 'ape', 'bee']}) },\nBag: { count: (b, {prefix}) => prefix ? b.items.filter(i => i.startsWith(prefix)).length : b.items.length }", "expected_response": "{\"data\":{\"bag\":{\"all\":3,\"wit...
cmsvrifby02teg4p2xysc0kdg
Submission SC0KDG
{ "sample_query": "{ total(values: [1,2,3]) }", "resolver_code": "Query: { total: async (_, {values}) => (await Promise.all(values.map(async v => v + 1))).reduce((a, b) => a + b, 0) }", "expected_response": "{\"data\":{\"total\":9}}", "schema_definition": "type Query { total(values: [Int!]!): Int! }" }
cmsvrifby02tfg4p28hish9ui
Submission ISH9UI
{ "sample_query": "{ jobs { id status } }", "resolver_code": "Query: { jobs: async () => [{id: 'j1', status: 'done'}, {id: 'j2', status: 'queued'}] }", "expected_response": "{\"data\":{\"jobs\":[{\"id\":\"j1\",\"status\":\"done\"},{\"id\":\"j2\",\"status\":\"queued\"}]}}", "schema_definition": "type Job { id: I...
cmsvrifby02tgg4p2g46nuob1
Submission 6NUOB1
{ "sample_query": "{ slow }", "resolver_code": "Query: { slow: () => Promise.resolve('resolved') }", "expected_response": "{\"data\":{\"slow\":\"resolved\"}}", "schema_definition": "type Query { slow: String! }" }
cmsvrifby02thg4p2z09coltr
Submission 9COLTR
{ "sample_query": "{ failing }", "resolver_code": "Query: { failing: async () => { throw new Error('upstream unavailable'); } }", "expected_response": "{\"errors\":[{\"message\":\"upstream unavailable\"}],\"data\":null}", "schema_definition": "type Query { failing: String! }" }
cmsvrifby02tig4p2idi7f8m4
Submission I7F8M4
{ "sample_query": "mutation { addTask(input: {title: \"write\", priority: 0}) { title priority } }", "resolver_code": "Query: { _: () => null },\nMutation: { addTask: (_, {input}) => { if (input.priority < 1) throw new Error('priority must be at least 1'); return input; } }", "expected_response": "{\"errors\":[{\...
cmsvrifby02tjg4p2zfpjcipf
Submission PJCIPF
{ "sample_query": "mutation { rename(input: {id: \"7\", name: \" spaced \"}) { id name } }", "resolver_code": "Query: { _: () => null },\nMutation: { rename: (_, {input}) => ({id: input.id, name: input.name.trim()}) }", "expected_response": "{\"data\":{\"rename\":{\"id\":\"7\",\"name\":\"spaced\"}}}", "schema...
cmsvrifby02tkg4p2cojxk4td
Submission JXK4TD
{ "sample_query": "mutation { first: ping { ok message } second: ping { message } }", "resolver_code": "Query: { _: () => null },\nMutation: { ping: () => ({ok: true, message: 'pong'}) }", "expected_response": "{\"data\":{\"first\":{\"ok\":true,\"message\":\"pong\"},\"second\":{\"message\":\"pong\"}}}", "schema...
cmsvrifby02tlg4p2v3b47m5f
Submission B47M5F
{ "sample_query": "{ profile { handle missingField } }", "resolver_code": "Query: { profile: () => ({handle: 'x'}) }", "expected_response": "{\"errors\":[{\"message\":\"Cannot query field \\\"missingField\\\" on type \\\"Profile2\\\".\"}]}", "schema_definition": "type Profile2 { handle: String! }\ntype Query { ...
cmsvrifby02tmg4p2jd14zgu7
Submission 14ZGU7
{ "sample_query": "{ name notARootField }", "resolver_code": "Query: { name: () => 'x' }", "expected_response": "{\"errors\":[{\"message\":\"Cannot query field \\\"notARootField\\\" on type \\\"Query\\\".\"}]}", "schema_definition": "type Query { name: String! }" }
cmsvrifby02tng4p2dmsi48ha
Submission SI48HA
{ "sample_query": "{ thing }", "resolver_code": "Query: { thing: () => ({id: '1'}) }", "expected_response": "{\"errors\":[{\"message\":\"Field \\\"thing\\\" of type \\\"Thing!\\\" must have a selection of subfields. Did you mean \\\"thing { ... }\\\"?\"}]}", "schema_definition": "type Thing { id: ID! }\ntype Qu...
cmsvrifby02tog4p27bql7q0s
Submission QL7Q0S
{ "sample_query": "{ value { nested } }", "resolver_code": "Query: { value: () => 1 }", "expected_response": "{\"errors\":[{\"message\":\"Field \\\"value\\\" must not have a selection since type \\\"Int!\\\" has no subfields.\"}]}", "schema_definition": "type Query { value: Int! }" }
cmsvrifby02tpg4p27lmq0ek0
Submission MQ0EK0
{ "sample_query": "{ widget { id label __typename } }", "resolver_code": "Query: { widget: () => ({id: 'w', label: null}) }", "expected_response": "{\"data\":{\"widget\":{\"id\":\"w\",\"label\":null,\"__typename\":\"Widget\"}}}", "schema_definition": "type Widget { id: ID!, label: String }\ntype Query { widget:...
cmsvrifby02tqg4p2tvba0xsc
Submission BA0XSC
{ "sample_query": "{ __type(name: \"Alpha\") { name kind fields { name } } }", "resolver_code": "Query: { alpha: () => ({a: 1}) }", "expected_response": "{\"data\":{\"__type\":{\"name\":\"Alpha\",\"kind\":\"OBJECT\",\"fields\":[{\"name\":\"a\"}]}}}", "schema_definition": "type Alpha { a: Int! }\ntype Query { al...
cmsvrqoez02trg4p2q37p6ryv
Submission 7P6RYV
{ "sample_query": "{ aa bb }", "resolver_code": "Query: { aa: () => [1, null], bb: () => null }", "expected_response": "{\"data\":{\"aa\":[1,null],\"bb\":null}}", "schema_definition": "type Query { aa: [Int]!, bb: [Int!] }" }
cmsvrqoez02tsg4p213ptohju
Submission PTOHJU
{ "sample_query": "{ grid }", "resolver_code": "Query: { grid: () => [[1,2],[3,4]] }", "expected_response": "{\"data\":{\"grid\":[[1,2],[3,4]]}}", "schema_definition": "type Query { grid: [[Int!]!]! }" }
cmsvrqoez02ttg4p29tzq8bfk
Submission ZQ8BFK
{ "sample_query": "{ ragged }", "resolver_code": "Query: { ragged: () => [[1,null],[null]] }", "expected_response": "{\"data\":{\"ragged\":[[1,null],[null]]}}", "schema_definition": "type Query { ragged: [[Int]!]! }" }
cmsvrqoez02tug4p28la5kz4a
Submission A5KZ4A
{ "sample_query": "{ empties }", "resolver_code": "Query: { empties: () => [] }", "expected_response": "{\"data\":{\"empties\":[]}}", "schema_definition": "type Query { empties: [String!]! }" }
cmsvrqoez02tvg4p2dpquehc7
Submission QUEHC7
{ "sample_query": "{ sq: pow(base: 3, exp: 2) cube: pow(base: 3, exp: 3) }", "resolver_code": "Query: { pow: (_, {base, exp}) => Math.pow(base, exp) }", "expected_response": "{\"data\":{\"sq\":9,\"cube\":27}}", "schema_definition": "type Query { pow(base: Int!, exp: Int!): Int! }" }
cmsvrqoez02twg4p2hxwptnx8
Submission WPTNX8
{ "sample_query": "{ once: repeat(text: \"ab\", times: 1) thrice: repeat(text: \"ab\", times: 3) }", "resolver_code": "Query: { repeat: (_, {text, times}) => text.repeat(times) }", "expected_response": "{\"data\":{\"once\":\"ab\",\"thrice\":\"ababab\"}}", "schema_definition": "type Query { repeat(text: String!,...
cmsvrqoez02txg4p2walmb402
Submission LMB402
{ "sample_query": "{ under: clamp(v: -5, lo: 0, hi: 10) over: clamp(v: 99, lo: 0, hi: 10) inside: clamp(v: 4, lo: 0, hi: 10) }", "resolver_code": "Query: { clamp: (_, {v, lo, hi}) => Math.min(hi, Math.max(lo, v)) }", "expected_response": "{\"data\":{\"under\":0,\"over\":10,\"inside\":4}}", "schema_definition": ...
cmsvrqoez02tyg4p25lme76tl
Submission ME76TL
{ "sample_query": "{ omitted: describe explicitNull: describe(note: null) given: describe(note: \"hi\") }", "resolver_code": "Query: { describe: (_, {note}) => note === undefined ? 'absent' : note === null ? 'explicit null' : 'value:' + note }", "expected_response": "{\"data\":{\"omitted\":\"absent\",\"explicitNu...
cmsvrqoez02tzg4p2pu7kybde
Submission 7KYBDE
{ "sample_query": "{ a: pick b: pick(n: null) c: pick(n: 0) }", "resolver_code": "Query: { pick: (_, {n}) => String(n) }", "expected_response": "{\"data\":{\"a\":\"undefined\",\"b\":\"null\",\"c\":\"0\"}}", "schema_definition": "type Query { pick(n: Int): String! }" }
cmsvrqoez02u0g4p2r3redorg
Submission REDORG
{ "sample_query": "{ names(cs: [RED, BLUE, RED]) }", "resolver_code": "Query: { names: (_, {cs}) => cs.map(c => c.toLowerCase()) }", "expected_response": "{\"data\":{\"names\":[\"red\",\"blue\",\"red\"]}}", "schema_definition": "enum Colour { RED BLUE }\ntype Query { names(cs: [Colour!]!): [String!]! }" }
cmsvrqoez02u1g4p2mczav424
Submission ZAV424
{ "sample_query": "{ metric: grams(w: {amount: 2, unit: KG}) imperial: grams(w: {amount: 2, unit: LB}) }", "resolver_code": "Query: { grams: (_, {w}) => w.unit === 'KG' ? w.amount * 1000 : Math.round(w.amount * 453.592) }", "expected_response": "{\"data\":{\"metric\":2000,\"imperial\":907}}", "schema_definition...
cmsvrqoez02u3g4p28fncpp7w
Submission NCPP7W
{ "sample_query": "{ area(b: {tl: {x: 0, y: 0}, br: {x: 3, y: 4}}) }", "resolver_code": "Query: { area: (_, {b}) => Math.abs((b.br.x - b.tl.x) * (b.br.y - b.tl.y)) }", "expected_response": "{\"data\":{\"area\":12}}", "schema_definition": "input Point { x: Int!, y: Int! }\ninput Box { tl: Point!, br: Point! }\nt...
cmsvrqoez02u5g4p2m65sgfid
Submission 5SGFID
{ "sample_query": "{ dflt: plan(c: {label: \"a\"}) set: plan(c: {label: \"b\", retries: 7}) }", "resolver_code": "Query: { plan: (_, {c}) => c.label + ' x' + c.retries }", "expected_response": "{\"data\":{\"dflt\":\"a x3\",\"set\":\"b x7\"}}", "schema_definition": "input Cfg { retries: Int = 3, label: String! }...
cmsvrqoez02u7g4p2iahit7qv
Submission HIT7QV
{ "sample_query": "{ good bad }", "resolver_code": "Query: { good: () => 1, bad: () => { throw new Error('bad failed'); } }", "expected_response": "{\"errors\":[{\"message\":\"bad failed\"}],\"data\":null}", "schema_definition": "type Query { good: Int!, bad: Int! }" }
cmsvrqoez02u8g4p2bo3jp3ak
Submission 3JP3AK
{ "sample_query": "{ one two three }", "resolver_code": "Query: { one: () => 'a', two: () => { throw new Error('two broke'); }, three: () => 'c' }", "expected_response": "{\"errors\":[{\"message\":\"two broke\"}],\"data\":null}", "schema_definition": "type Query { one: String!, two: String!, three: String! }" }
cmsvrqoez02u9g4p2qnfnhfj2
Submission FNHFJ2
{ "sample_query": "{ left { inner } right { inner } }", "resolver_code": "Query: { left: () => ({inner: 1}), right: () => ({}) }", "expected_response": "{\"errors\":[{\"message\":\"Cannot return null for non-nullable field Wrap.inner.\"}],\"data\":null}", "schema_definition": "type Wrap { inner: Int! }\ntype Qu...
cmsvrqoez02uag4p2vpuzp97u
Submission UZP97U
{ "sample_query": "{ rect { w h area perimeter } }", "resolver_code": "Query: { rect: () => ({w: 3, h: 5}) },\nRect: { area: (r) => r.w * r.h, perimeter: (r) => 2 * (r.w + r.h) }", "expected_response": "{\"data\":{\"rect\":{\"w\":3,\"h\":5,\"area\":15,\"perimeter\":16}}}", "schema_definition": "type Rect { w: I...
cmsvrqoez02ubg4p2xf4yzc4z
Submission 4YZC4Z
{ "sample_query": "{ person { full initials } }", "resolver_code": "Query: { person: () => ({first: 'ada', last: 'lovelace'}) },\nPerson: { full: (p) => p.first + ' ' + p.last, initials: (p) => (p.first[0] + p.last[0]).toUpperCase() }", "expected_response": "{\"data\":{\"person\":{\"full\":\"ada lovelace\",\"init...
cmsvrqoez02ucg4p2pj27es37
Submission 27ES37
{ "sample_query": "{ files { bytes human } }", "resolver_code": "Query: { files: () => [{bytes: 512}, {bytes: 2048}, {bytes: 1048576}] },\nFile2: { human: (f) => f.bytes >= 1048576 ? (f.bytes / 1048576) + 'MB' : f.bytes >= 1024 ? (f.bytes / 1024) + 'KB' : f.bytes + 'B' }", "expected_response": "{\"data\":{\"files...
cmsvrqoez02udg4p2591jfuqr
Submission 1JFUQR
{ "sample_query": "{ scores { raw banded } }", "resolver_code": "Query: { scores: () => [{raw: 95}, {raw: 71}, {raw: 40}] },\nScore: { banded: (s) => s.raw >= 90 ? 'A' : s.raw >= 70 ? 'B' : 'F' }", "expected_response": "{\"data\":{\"scores\":[{\"raw\":95,\"banded\":\"A\"},{\"raw\":71,\"banded\":\"B\"},{\"raw\":40...
cmsvrqoez02ueg4p27b56utvj
Submission 56UTVJ
{ "sample_query": "{ root2 { name child { name child { name } } } }", "resolver_code": "Query: { root2: () => ({name: 'a', child: {name: 'b', child: null}}) }", "expected_response": "{\"data\":{\"root2\":{\"name\":\"a\",\"child\":{\"name\":\"b\",\"child\":null}}}}", "schema_definition": "type Dir { name: String...
cmsvrqoez02ufg4p238qolt45
Submission QOLT45
{ "sample_query": "{ tree { label subs { label subs { label } } } }", "resolver_code": "Query: { tree: () => ({label: 'top', subs: [{label: 'l', subs: []}, {label: 'r', subs: [{label: 'rr', subs: []}]}]}) }", "expected_response": "{\"data\":{\"tree\":{\"label\":\"top\",\"subs\":[{\"label\":\"l\",\"subs\":[]},{\"l...
cmsvrqoez02ugg4p2ca4diggp
Submission 4DIGGP
{ "sample_query": "mutation { shift(m: {dx: 2, dy: -3}) { x y } }", "resolver_code": "Query: { _q: () => null },\nMutation: { shift: (_, {m}) => ({x: m.dx, y: m.dy}) }", "expected_response": "{\"data\":{\"shift\":{\"x\":2,\"y\":-3}}}", "schema_definition": "input Move { dx: Int!, dy: Int! }\ntype Pos { x: Int!,...
cmsvrqoez02uhg4p2l50tv9jd
Submission 0TV9JD
{ "sample_query": "mutation { send(payload: [\"a\",\"b\",\"c\"]) { received } }", "resolver_code": "Query: { _q: () => null },\nMutation: { send: (_, {payload}) => ({received: payload.length}) }", "expected_response": "{\"data\":{\"send\":{\"received\":3}}}", "schema_definition": "type Ack { received: Int! }\nt...
cmsvrqoez02uig4p2ln9d4k5m
Submission 9D4K5M
{ "sample_query": "mutation { login(c: {user: \"ada\", pass: \"short\"}) { token } }", "resolver_code": "Query: { _q: () => null },\nMutation: { login: (_, {c}) => { if (c.pass.length < 8) throw new Error('password too short'); return {token: 't-' + c.user}; } }", "expected_response": "{\"errors\":[{\"message\":\...
cmsvrqoez02ujg4p29vsrfh8m
Submission SRFH8M
{ "sample_query": "mutation { a: bump { value } b: bump(by: 10) { value } }", "resolver_code": "Query: { _q: () => null },\nMutation: { bump: (_, {by}) => ({value: by}) }", "expected_response": "{\"data\":{\"a\":{\"value\":1},\"b\":{\"value\":10}}}", "schema_definition": "type Counter2 { value: Int! }\ntype Mut...
cmsvrqoez02ukg4p24156l7tx
Submission 56L7TX
{ "sample_query": "{ n(unexpectedArg: 1) }", "resolver_code": "Query: { n: () => 1 }", "expected_response": "{\"errors\":[{\"message\":\"Unknown argument \\\"unexpectedArg\\\" on field \\\"Query.n\\\".\"}]}", "schema_definition": "type Query { n: Int! }" }
cmsvrqoez02ulg4p293kyxs83
Submission KYXS83
{ "sample_query": "query Broken { s", "resolver_code": "Query: { s: () => 'x' }", "expected_response": "{\"errors\":[{\"message\":\"Syntax Error: Expected Name, found <EOF>.\"}]}", "schema_definition": "type Query { s: String! }" }
cmsvrqoez02umg4p295qt0x3i
Submission QT0X3I
{ "sample_query": "{ obj { a } obj { b } }", "resolver_code": "Query: { obj: () => ({a: 1}) }", "expected_response": "{\"errors\":[{\"message\":\"Cannot query field \\\"b\\\" on type \\\"Obj2\\\". Did you mean \\\"a\\\"?\"}]}", "schema_definition": "type Obj2 { a: Int! }\ntype Query { obj: Obj2! }" }
cmsvrqoez02uog4p2uzc9estk
Submission C9ESTK
{ "sample_query": "{ ...NoSuchFragment }", "resolver_code": "Query: { x: () => 1 }", "expected_response": "{\"errors\":[{\"message\":\"Unknown fragment \\\"NoSuchFragment\\\".\"}]}", "schema_definition": "type Query { x: Int! }" }
cmsvrqoez02upg4p2qzqqy26h
Submission QQY26H
{ "sample_query": "{ zero neg big }", "resolver_code": "Query: { zero: () => 0, neg: () => -2147483648, big: () => 2147483647 }", "expected_response": "{\"data\":{\"zero\":0,\"neg\":-2147483648,\"big\":2147483647}}", "schema_definition": "type Query { zero: Int!, neg: Int!, big: Int! }" }
cmsvrqof002uqg4p2tx71dcun
Submission 71DCUN
{ "sample_query": "{ over }", "resolver_code": "Query: { over: () => 2147483648 }", "expected_response": "{\"errors\":[{\"message\":\"Int cannot represent non 32-bit signed integer value: 2147483648\"}],\"data\":null}", "schema_definition": "type Query { over: Int! }" }
cmsvrqof002urg4p2qsrlqf3i
Submission RLQF3I
{ "sample_query": "{ emptyStr spaces }", "resolver_code": "Query: { emptyStr: () => '', spaces: () => ' ' }", "expected_response": "{\"data\":{\"emptyStr\":\"\",\"spaces\":\" \"}}", "schema_definition": "type Query { emptyStr: String!, spaces: String! }" }
cmsvrqof002usg4p29nyk4bsk
Submission YK4BSK
{ "sample_query": "{ unicode }", "resolver_code": "Query: { unicode: () => 'caf\\u00e9 \\u2014 na\\u00efve' }", "expected_response": "{\"data\":{\"unicode\":\"café — naïve\"}}", "schema_definition": "type Query { unicode: String! }" }
cmsvrqof002utg4p2g5xp8ad4
Submission XP8AD4
{ "sample_query": "{ quoted }", "resolver_code": "Query: { quoted: () => 'he said \\\"hi\\\" and left' }", "expected_response": "{\"data\":{\"quoted\":\"he said \\\"hi\\\" and left\"}}", "schema_definition": "type Query { quoted: String! }" }
cmsvrqof002uug4p2bhemgja3
Submission EMGJA3
{ "sample_query": "{ __type(name: \"Beta\") { name kind } }", "resolver_code": "Query: { beta: () => ({b: 'x'}) }", "expected_response": "{\"data\":{\"__type\":{\"name\":\"Beta\",\"kind\":\"OBJECT\"}}}", "schema_definition": "type Beta { b: String! }\ntype Query { beta: Beta! }" }