Run a reading room’s card index: the Apollo cache, normalisation, paging and optimistic updates. 15 levels, played right in the browser with nothing to install.
What the levels ask
Taman Bacaan Kecapi has just joined Pustaka Desa: the Perpustakaan District's catalogue can now be asked through GraphQL. Mrs. Ratna brings class 5 this morning, and the shelf TV has to show each book's title, author name, copies left and cover colour. Tap the fields to ask katalog for. Bagas carries the question to the district: don't load his bag with what the TV never shows.
Grandma Marni wants to read her grandchild's class magazine. Its title is written with quotation marks, Mading "Kecapi" Edisi 3, and that is how she types it. Pick the body of cari so that Grandma's phone finds the book she is looking for, whatever she types.
The tablet on Ms. Intan's desk shows the book card with its synopsis. Ms. Wulan's phone uses the same BUKU query, but its screen is small and shows no synopsis: her data plan should not go on text nobody reads. Pick the BUKU query both of them use.
Dina has redesigned the book card: it now shows the copies left too. The KartuBuku component is used on the TV and in the Pinjamanku list on Rara's phone, and the fields it needs are written in its own fragment. Pick the query for the TV and for the phone so that both draw the new card in full.
Bagas slimmed down the TV's query: "The TV never shows a book's number, why ask for it?" This morning Mr. Tono borrows Sang Pemimpi, the last copy. The desk tablet shows 0 at once, but the TV still says there is 1. Fix the katalog fields so that the TV changes too, without asking again.
Rara renews her loan of Keluarga Cemara for a week. The district's server already has the new return date, but Rara's phone still shows the old one. Pick the fields the perpanjang mutation brings home so that the Pinjamanku list is right at once, without sending Bagas to ask again.
The Reading Champions board shows every member's points, and Rara's phone shows her own card. Members have no id: the district knows them by their member number. Rara has just handed in a review and earned ten points. Set up InMemoryCache so that the board and Rara's phone both go up, and every member is still counted on their own.
The neighbourhood head donates Ronggeng Dukuh Paruk. The sumbang mutation returns the new book in full, but the katalog list in the cache has no idea the book belongs in it. Pick what happens after sumbang so that the TV shows the book in the same place as the district's list, without Bagas going to the district again.
The New Shelf TV shows the three newest books and a Load more button. Meanwhile, at the district, Mrs. Sari donates a book, which makes it the newest. Then Dimas taps Load more. Pick how the TV asks for the next page so that the six books on screen are in order, with none twice and none skipped.
The TV now uses a cursor, but the card index does not know how to join pages: each page is kept on its own. Dimas taps Load more twice before Bagas is back. Pick the policy for the rakBaru field so that the TV shows six books in order, none twice.
The district has lost the author card of Totto-chan: the penulis resolver fails for that book. In this schema the katalog list may hold null. Mr. Harun wants the TV to keep showing the other books, and to say that one book could not be read. Pick the TV's error policy.
Totto-chan's author card is still lost, and Mr. Piksel wants to know the damage before switching the screens on. Read the schema: katalog may not hold null, buku may. For the TV and for the tablet, guess where the null lands when the penulis resolver fails, then watch the answer.