This is the generated code that came from a graphql generated wordpress endpoint.
type rec response_menus_edges_node = {
name: option<string>,
}
and response_menus_edges = {
cursor: option<string>,
node: option<response_menus_edges_node>,
}
and response_menus = {
edges: option<array<option<response_menus_edges>>>,
}
type response = {
menus: option<response_menus>,
}
What I came so far is
let default = (props: props) => {
open Belt
<div>
{switch props.menus->Option.flatMap(m => m.edges) {
| Some(e) => e->Belt.Array.map(e => e->Belt.Option.getWithDefault())
| None => React.null
}}
</div>
}
But I’m lost after that. thanks.