Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
haskell-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
Przemyslaw Kaminski
haskell-gargantext
Commits
50d10679
Commit
50d10679
authored
Dec 02, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graphql] remove ethercalc endpoint
parent
4aaedab0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
75 deletions
+2
-75
GraphQL.hs
src/Gargantext/API/GraphQL.hs
+2
-5
Ethercalc.hs
src/Gargantext/API/GraphQL/Ethercalc.hs
+0
-70
No files found.
src/Gargantext/API/GraphQL.hs
View file @
50d10679
...
@@ -33,7 +33,6 @@ import Gargantext.API.Admin.Auth.Types (AuthenticatedUser)
...
@@ -33,7 +33,6 @@ import Gargantext.API.Admin.Auth.Types (AuthenticatedUser)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
)
import
Gargantext.API.Prelude
(
HasJobEnv
'
)
import
Gargantext.API.Prelude
(
HasJobEnv
'
)
import
qualified
Gargantext.API.GraphQL.AsyncTask
as
GQLAT
import
qualified
Gargantext.API.GraphQL.AsyncTask
as
GQLAT
import
qualified
Gargantext.API.GraphQL.Ethercalc
as
GQLEthercalc
import
qualified
Gargantext.API.GraphQL.Node
as
GQLNode
import
qualified
Gargantext.API.GraphQL.Node
as
GQLNode
import
qualified
Gargantext.API.GraphQL.User
as
GQLUser
import
qualified
Gargantext.API.GraphQL.User
as
GQLUser
import
qualified
Gargantext.API.GraphQL.UserInfo
as
GQLUserInfo
import
qualified
Gargantext.API.GraphQL.UserInfo
as
GQLUserInfo
...
@@ -70,8 +69,7 @@ data Query m
...
@@ -70,8 +69,7 @@ data Query m
data
Mutation
m
data
Mutation
m
=
Mutation
=
Mutation
{
ethercalc_csv_download
::
GQLEthercalc
.
EthercalcCSVDownloadArgs
->
m
Int
{
update_user_info
::
GQLUserInfo
.
UserInfoMArgs
->
m
Int
}
,
update_user_info
::
GQLUserInfo
.
UserInfoMArgs
->
m
Int
}
deriving
(
Generic
,
GQLType
)
deriving
(
Generic
,
GQLType
)
-- | Possible GraphQL Events, i.e. here we describe how we will
-- | Possible GraphQL Events, i.e. here we describe how we will
...
@@ -101,8 +99,7 @@ rootResolver =
...
@@ -101,8 +99,7 @@ rootResolver =
,
node_parent
=
GQLNode
.
resolveNodeParent
,
node_parent
=
GQLNode
.
resolveNodeParent
,
user_infos
=
GQLUserInfo
.
resolveUserInfos
,
user_infos
=
GQLUserInfo
.
resolveUserInfos
,
users
=
GQLUser
.
resolveUsers
}
,
users
=
GQLUser
.
resolveUsers
}
,
mutationResolver
=
Mutation
{
ethercalc_csv_download
=
GQLEthercalc
.
ethercalcCSVDownload
,
mutationResolver
=
Mutation
{
update_user_info
=
GQLUserInfo
.
updateUserInfo
}
,
update_user_info
=
GQLUserInfo
.
updateUserInfo
}
,
subscriptionResolver
=
Undefined
}
,
subscriptionResolver
=
Undefined
}
-- | Main GraphQL "app".
-- | Main GraphQL "app".
...
...
src/Gargantext/API/GraphQL/Ethercalc.hs
deleted
100644 → 0
View file @
4aaedab0
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
module
Gargantext.API.GraphQL.Ethercalc
where
import
Control.Lens
((
^.
))
import
Data.Either
(
Either
(
..
))
import
Data.Morpheus.Types
(
GQLType
,
Resolver
,
ResolverM
,
QUERY
,
lift
)
import
Data.Text
(
Text
)
import
qualified
Data.Text
as
T
import
Gargantext.API.Job
(
jobLogInit
)
import
qualified
Gargantext.API.Node.Corpus.New
as
New
import
Gargantext.API.Prelude
(
GargM
,
GargServerT
,
GargError
)
import
Gargantext.Core.Mail.Types
(
HasMail
)
import
Gargantext.Core.Types
(
NodeId
(
..
))
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
),
NodeType
)
import
Gargantext.Database.Admin.Types.Hyperdata
(
HyperdataFrame
,
getHyperdataFrameCSV
)
import
qualified
Gargantext.Database.Admin.Types.Node
as
NN
import
Gargantext.Database.Query.Table.Node
(
getClosestParentIdByType
,
getNode
,
getNodeWith
)
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
qualified
Gargantext.Database.Schema.Node
as
N
import
Gargantext.Prelude
import
GHC.Generics
(
Generic
)
import
qualified
Prelude
as
Prelude
import
Servant
(
Proxy
(
..
))
import
Servant.Job.Async
(
serveJobsAPI
,
JobFunction
(
..
))
import
Text.Read
(
readEither
)
data
EthercalcCSVDownload
=
EthercalcCSVDownload
{
corpusId
::
Int
,
nodeId
::
Int
}
deriving
(
Show
,
Generic
,
GQLType
)
data
EthercalcCSVDownloadArgs
=
EthercalcCSVDownloadArgs
{
corpusId
::
Int
,
nodeId
::
Int
}
deriving
(
Generic
,
GQLType
)
type
GqlM
e
env
=
Resolver
QUERY
e
(
GargM
env
GargError
)
-- | Function to resolve user from a query.
ethercalcCSVDownload
::
(
HasConnectionPool
env
,
HasConfig
env
,
HasMail
env
)
=>
EthercalcCSVDownloadArgs
->
ResolverM
e
(
GargM
env
GargError
)
Int
ethercalcCSVDownload
(
EthercalcCSVDownloadArgs
{
corpusId
,
nodeId
})
=
do
ret
<-
lift
$
do
frameCalc
<-
getNodeWith
(
NodeId
nodeId
)
(
Proxy
::
Proxy
HyperdataFrame
)
printDebug
"[ethercalcCSVDownload] frameCalc"
frameCalc
csv
<-
liftBase
$
getHyperdataFrameCSV
(
frameCalc
^.
N
.
node_hyperdata
)
printDebug
"[ethercalcCSVDownload] csv"
csv
serveJobsAPI
$
JobFunction
(
\
i
log'
->
let
log''
x
=
do
printDebug
"[ethercalcCSVDownload] "
x
liftBase
$
log'
x
in
New
.
addToCorpusWithForm
user
corpusId
i
log''
(
jobLogInit
3
))
lift
$
printDebug
"[ethercalcCSVDownload] ret"
ret
pure
0
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