git.iko.soy/rowtype-yoga/purescript-yoga-fetch-om
on main help sign in
Document 0.8 query migration
e85b103Mark
README.md+21
@@ -14,6 +14,27 @@ Optional query examples below use [`justifill`](https://pursuit.purescript.org/p
14spago install justifill
14spago install justifill
15```
15```
16
16
17+## Migrating from 0.7
18+
19+Version 0.8 exposes optional query parameters as explicit `Maybe` fields. Calls that passed plain values no longer compile:
20+
21+```purescript
22+-- 0.7
23+users <- api.listUsers { limit: 10, offset: 0 }
24+
25+-- 0.8
26+users <- api.listUsers { limit: Just 10, offset: Just 0 }
27+allUsers <- api.listUsers { limit: Nothing, offset: Nothing }
28+```
29+
30+Import `Maybe(..)` from `Data.Maybe` when constructing these records directly. Alternatively, [`justifill`](https://pursuit.purescript.org/packages/purescript-justifill) wraps supplied values in `Just` and fills omitted fields with `Nothing`:
31+
32+```purescript
33+users <- api.listUsers (justifill { limit: 10 })
34+```
35+
36+Path parameters and request bodies keep their existing argument shapes.
37+
17## Quick Start
38## Quick Start
18
39
19### Example 1: Simple GET and POST Requests
40### Example 1: Simple GET and POST Requests