問題タブ [bucklescript]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ocaml - ネストされた再帰データのデータ型を定義する方法
私はjs側からデータを取得しました。これは、このように見え
{
"selectionSet": {
"type": 1,
"selections": [
{
"name": {
"kind": "Name",
"value": "viewer"
},
"selectionSet": {
"type": 1,
"selections": [
{
"name": {
"kind": "Name",
"value": "avatarUrl"
},
"selectionSet": null
}
]
}
}
]
}
}
ます。selectionSet
selections
を定義するとき、型が のフィールドがあるのでselections
定義するべきだったようです。しかし、定義されている場合、定義する必要がありましたselectionSet
selectionSet
selectionSet
selections
誰かがOCamlスタイルで答えることができますか? この JSON 形式のデータをレコードに変換したいと考えています。