February 2019
Beginner to intermediate
180 pages
4h 4m
English
The getItem binding defined in the previous section will return a string:
let unvalidated = DataPureReason.getItem("customers");
We can validate the JSON string like so:
let validated = try (Js.Json.parseExn(unvalidated)) { | _ => failwith("Error parsing JSON string") };
If the JSON is not valid, it will generate a runtime error. At the end of the chapter, we'll learn how GraphQL can help improve this situation.
Read now
Unlock full access