Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
6e5b1704
Commit
6e5b1704
authored
Nov 29, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] some endpoint work [does not compile]
parent
e004b064
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
18 deletions
+21
-18
GraphQL.purs
src/Gargantext/Components/GraphQL.purs
+2
-2
Endpoints.purs
src/Gargantext/Components/GraphQL/Endpoints.purs
+19
-15
Node.purs
src/Gargantext/Components/GraphQL/Node.purs
+0
-1
No files found.
src/Gargantext/Components/GraphQL.purs
View file @
6e5b1704
...
...
@@ -11,7 +11,7 @@ import Effect.Class (liftEffect)
import Foreign (unsafeToForeign, ForeignError)
import Gargantext.Components.GraphQL.Node (EthercalcCSVDownloadM, Node)
import Gargantext.Components.GraphQL.User (User, UserInfo, UserInfoM)
import Gargantext.Components.GraphQL.Task
(AsyncTaskWithType)
import Gargantext.Components.GraphQL.Task
as GQT
import Gargantext.Prelude
import Gargantext.Sessions (Session(..))
import Gargantext.Utils.Reactix as R2
...
...
@@ -73,5 +73,5 @@ type Schema
}
type Mutation
= { ethercalc_csv_download :: EthercalcCSVDownloadM ==> Maybe AsyncTaskWithType
= { ethercalc_csv_download :: EthercalcCSVDownloadM ==> Maybe
GQT.
AsyncTaskWithType
, update_user_info :: UserInfoM ==> Int }
src/Gargantext/Components/GraphQL/Endpoints.purs
View file @
6e5b1704
module Gargantext.Components.GraphQL.Endpoints where
import Gargantext.Components.GraphQL.Node
import Gargantext.Components.GraphQL.User
import Gargantext.Prelude
import Data.Array as A
import Data.Either (Either(..))
import Data.Maybe (Maybe(..))
import Data.Unit (unit)
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
import Gargantext.Components.GraphQL (getClient, queryGql)
import Gargantext.Components.GraphQL.Node
import Gargantext.Components.GraphQL.User
import Gargantext.Config.REST (AffRESTError, RESTError(..))
import Gargantext.Prelude
import Gargantext.Sessions (Session)
import Gargantext.Types (AsyncTaskWithType(..), AsyncTask(..), AsyncTaskType(..), NodeType)
import Gargantext.Utils.Reactix as R2
...
...
@@ -45,15 +47,17 @@ triggerEthercalcCSVDownload session corpusId nodeId = do
client
"trigger ethercalc CSV download"
{ ethercalc_csv_download: onlyArgs { corpusId
, nodeId } }
pure $ case res.ethercalc_csv_download of
Nothing -> Nothing
Just { task: { id, status }, typ } ->
case JSON.readJSON typ of
Left _ -> Nothing
Right typ_ ->
case JSON.readJSON status of
Left _ -> Nothing
Right status_ ->
Just $ AsyncTaskWithType { task: AsyncTask { id, status: status_ }
, typ: typ_ }
, nodeId }
pure Nothing
-- pure $ case res.ethercalc_csv_download of
-- Nothing -> Nothing
-- Just { task: { id, status }, typ } ->
-- case JSON.readJSON typ of
-- Left _ -> Nothing
-- Right typ_ ->
-- case JSON.readJSON status of
-- Left _ -> Nothing
-- Right status_ ->
-- Just $ AsyncTaskWithType { task: AsyncTask { id, status: status_ }
-- , typ: typ_ }
--
src/Gargantext/Components/GraphQL/Node.purs
View file @
6e5b1704
...
...
@@ -4,7 +4,6 @@ import Gargantext.Prelude
import GraphQL.Client.Args ((=>>))
import GraphQL.Client.Variable (Var(..))
import Gargantext.Types (NodeType)
type Node
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment