Grow a homestay GraphQL schema without breaking old apps: evolution, DataLoader, cursors. 13 levels, played right in the browser with nothing to install.
What the levels ask
Ms. Widya looks after Singgah, the booking server of the Paguyuban Homestay Watu Lawang, on a laptop in the pavilion of Omah Kenanga. The homestay owners use three versions of the Singgah Pemilik app, never updated together. Ms. Lintang from the Pokdarwis wants a clearer name for the number of nights on her dashboard: jumlahMalam. Fill the holes in skema.graphql and server.js so her dashboard fills without a single old app being refused.
From today the paguyuban gives 15% off from the third night, up from 10%, and every app has to count it. Bagas suggests the REST way: make /graphql/v2 with a new schema without malam. The three old APKs call /graphql, and that address is built into the app. Fill the hole in rilis.js: which server answers at which address from tonight.
The paguyuban's new receipts print a booking code like WL-118, and Ms. Lintang wants to open a booking from that code on the dashboard. Right now pesanan only takes a numeric id. Each version writes its question its own way: version 1.4 writes the number in place, version 1.9 and the bot send a variable. Fill the cari hole, which fills the schema, the resolver and the dashboard's question at once.
Ms. Lintang counts the nights booked for the next thirty days. The hari argument of pesananSaya has a default of seven, and version 1.4 never sends hari: its screen is titled Tamu minggu ini (this week's guests). Fill the bawaan hole in skema.graphql and the dasbor hole in dasbor/bulan.graphql.
The bot now takes bookings that wait for a down payment (DP), and the database stores their status as MENUNGGU_DP. The three old phone versions know only four statuses, and their screen code maps each status to a text. The dashboard needs to know who has not paid. Fill the bayar hole in the schema and the resolver, and the dasbor hole in dasbor/dp.graphql.
There are four lines on Ms. Widya's tidy-up list for tonight's release: jumlahTamu on pesan becomes required; pesan takes a kamarId so homestayId is no longer required, letting the bot book by room; pemilik on Homestay is never empty any more; and a booking's homestay may be empty for a room booking. Each hole has two choices: the changed line, or the line as it is today. Pick what ships.
Query.iuran has been @deprecated for a year, replaced by tagihanIuran. bersihkan.js removes deprecated fields on Tuesday night when their usage count is zero. Fill the sumber hole in bersihkan.js: where the usage of iuran is counted from.
The WhatsApp bot starts taking PESAN KAMAR (book a room). When the room is taken, the guest has to be told why, not given an apology for an outage. Tomorrow, Thursday, the paguyuban adds a rule: a guest whose earlier deposit has not arrived may not book again. Fill the hasil hole: the shape of pesanKamar's answer, its resolver, the bot's question and its reply code.
A busy morning: Ms. Lintang scrolls the newest bookings five a page, while guests keep booking through the bot and one test booking is deleted. The dashboard loads over the Pos Pokdarwis hotspot, and each load may be at most 4,000 bytes. Fill the halaman hole: the shape of semuaPesanan in the schema and its resolver.
The dashboard's occupancy board shows this week's booked nights per homestay from one question: semuaHomestay { pesananMinggu { ... } }. Its SQLite log is very long, and Ms. Lintang opens it over a slow hotspot. Fill the resolver and batch holes in server.js so the board is right from two SQL statements at most.
This morning the owners open their guest lists in turn: Grandma Marni at 07.00, Mr. Karim at 07.45, Grandma Marni again at 08.00. At 07.30 Ms. Ratri books Omah Jati through the bot. pesananSaya now goes through DataLoader. Fill the loader hole in server.js: where that loader is made.
Three pull requests wait for tonight's release: rapikan drops the deprecated fotoLama, telepon renames hp on Tamu, and wajibTamu makes jumlahTamu required with a default of 2. The CI merges the PRs that pass its check. Fill the cek hole in ci.js.