Simpul GraphQL — GraphQL

Run a village street’s GraphQL API: tokens, field access, subscriptions, uploads, limits, a gateway. 16 levels, right in the browser.

What the levels ask

  1. Mr. Rendra came home from Jakarta and set up Simpul, the GraphQL API for Neighbourhood 03's villager apps, on the old computer in his house's front room. Grandma Marni's old app opens its home screen (Beranda) with three REST calls one after another, over a weak signal. Fill the two holes in hp-nenek/beranda.graphql so the screen fills with one request that carries only what it shows.
  2. The arrears screen shows the signed-in villager's name and arrears. The app sends a wargaId argument and an x-warga-id header, both from the app's memory. Today Ms. Wulan signs in on Mr. Dodi's phone, and Mr. Tono opens his app after signing out last night. Fill siapa in context and pemilik in the saya resolver.
  3. The warga(id) query already refuses anyone looking at another villager's data. But the Warga type can also be reached through pengumuman { penulis }, and the KartuWarga fragment on the announcements screen asks for hp and tunggakan too. The hall TV shows it without signing in. Fill the condition in pribadi, which the resolvers of those two private fields use.
  4. The neighbourhood head's tablet shows each villager's photo as he collects the dues. The photo store answers with an error for Grandma Marni, who has never had her photo taken. The other nine villagers must still show, and the error must be on record. Fill the foto type in skema.graphql and the foto resolver in server.js.
  5. The neighbourhood head pays in three dues in one mutation, aliased yanti, tono and ijah. Mr. Tono's entry says zero rupiah, and Mrs. Ijah's month is already paid. Mrs. Yanti's payment must still go in, and the tablet must know why the other two were refused. Fill tolakIsian in server.js and the fields chosen in tablet-rt/setor.graphql.
  6. Mrs. Sari's phone scrolls her payment history six per page, newest first. While she reads the first page, the neighbourhood head records the November payment, and that new row goes in at the top of the list. Fill the two holes in the pembayaranSaya resolver: where the next page starts, and when there are more pages.
  7. Mrs. Sari, Mr. Tono and Ms. Wulan wait for news of their cover letters through the suratBerubah subscription, carried by graphql-ws over a WebSocket (ws.js). Ms. Anis at the village office changes a letter's status with an ordinary HTTP mutation. Fill the filter in subscribe and where the token comes from in context.
  8. The queue machine at the village office's counter cannot send news, so nomorLoket checks it every five seconds for each subscriber, inside a Repeater. The hall TV watches all morning; Grandma Marni goes home once her number is called and closes her app. Fill the line after await stop.
  9. The street lamp at the end of the gang is out, and villagers report it with the laporLampuMati mutation and a photo (scalar File, sent as a multipart request by the browser's FormData). Mr. Tono sends a 900 KB photo, Mr. Dodi his original 14 MB one, and Ms. Wulan picks a PDF by mistake. Fill the checks in the resolver and in the onRequest plugin.
  10. Bagas wrote a neighbour recap script for the Karang Taruna, and copied tetangga { ... } until he was sure it would "get everyone". Each level multiplies the resolvers that run. At the same time the neighbourhood head's tablet opens the street map and Mrs. Sari's phone opens her neighbour list. Fill the limit n in maxDepthPlugin.
  11. Mr. Harun, the neighbourhood's treasurer, downloads three years of the cash book for the meeting: kas(first: 3000) with the pencatat of each row. Its depth is only three, so maxDepthPlugin lets it through. Simpul works out each query's cost with graphql-query-complexity. Fill the cost hint on the kas field and BIAYA_MAKS.
  12. From today Simpul answers only operations from the village apps' builds, sent as a sha256Hash. The lists are in operasi-v1.js (the villager app and the hall board) and operasi-v2.js (version 2.0 of the neighbourhood tablet app, which the neighbourhood head installed this morning). A visitor's laptop on the wifi tries all sorts. Fill the three holes in server.js.

And more, 16 levels in all.