Node.purs 794 Bytes
Newer Older
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
module Gargantext.Components.GraphQL.Node where

import Gargantext.Prelude

import GraphQL.Client.Args ((=>>))
import GraphQL.Client.Variable (Var(..))


type Node
  = { id        :: Int
    , name      :: String
    , parent_id :: Int
    , type_id   :: Int }

nodesQuery = { nodes: { node_id: Var :: _ "id" Int } =>>
               { id: unit
               , name: unit
               , parent_id: unit
               , type_id: unit }
             }

nodeParentQuery = { node_parent: { node_id: Var :: _ "id" Int
                                 , parent_type: Var :: _ "parent_type" String } =>>  -- TODO parent_type :: NodeType
                    { id: unit
                    , name: unit
                    , parent_id: unit
                    , type_id: unit }
                  }