1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Gargantext.Components.GraphQL.Tree where
import Gargantext.Prelude
import Data.Maybe (Maybe)
import Gargantext.Types (NodeType)
import GraphQL.Client.Args ((=>>))
import GraphQL.Client.Variable (Var(..))
type TreeNode =
{ name :: String
, id :: Int
, node_type :: NodeType
, parent_id :: Maybe Int
}
type TreeFirstLevel =
{ root :: TreeNode
, children :: Array TreeNode
, parent :: Maybe TreeNode
}
treeFirstLevelQuery = { tree: { root_id: Var :: _ "id" Int} =>>
{ root: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
, children: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
, parent: { name: unit
, node_type: unit
, id: unit
, parent_id: unit
}
}
}