Commit b092b18f authored by Karen Konou's avatar Karen Konou

[GQL] Update tree endpoint

parent 27399e65
...@@ -2,7 +2,7 @@ module Gargantext.Components.GraphQL.Endpoints where ...@@ -2,7 +2,7 @@ module Gargantext.Components.GraphQL.Endpoints where
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Components.GraphQL.Node (Node, nodeParentQuery) import Gargantext.Components.GraphQL.Node (Node, nodeParentQuery, nodesQuery)
import Gargantext.Components.GraphQL.Tree (TreeFirstLevel, treeFirstLevelQuery) import Gargantext.Components.GraphQL.Tree (TreeFirstLevel, treeFirstLevelQuery)
import Gargantext.Components.GraphQL.User (UserInfo, userInfoQuery) import Gargantext.Components.GraphQL.User (UserInfo, userInfoQuery)
......
...@@ -11,6 +11,7 @@ type TreeNode = ...@@ -11,6 +11,7 @@ type TreeNode =
{ name :: String { name :: String
, id :: Int , id :: Int
, node_type :: NodeType , node_type :: NodeType
, parent_id :: Maybe Int
} }
type TreeFirstLevel = type TreeFirstLevel =
{ root :: TreeNode { root :: TreeNode
...@@ -22,14 +23,17 @@ treeFirstLevelQuery = { tree: { root_id: Var :: _ "id" Int} =>> ...@@ -22,14 +23,17 @@ treeFirstLevelQuery = { tree: { root_id: Var :: _ "id" Int} =>>
{ root: { name: unit { root: { name: unit
, node_type: unit , node_type: unit
, id: unit , id: unit
, parent_id: unit
} }
, children: { name: unit , children: { name: unit
, node_type: unit , node_type: unit
, id: unit , id: unit
, parent_id: unit
} }
, parent: { name: unit , parent: { name: unit
, node_type: unit , node_type: unit
, id: unit , id: unit
, parent_id: unit
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment