Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
152
Issues
152
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
gargantext
haskell-gargantext
Commits
7cc5e33d
Commit
7cc5e33d
authored
Mar 31, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMT] backend serves imt orgs via graphql
parent
f1538012
Pipeline
#2622
failed with stage
in 54 minutes and 12 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
107 additions
and
77 deletions
+107
-77
GraphQL.hs
src/Gargantext/API/GraphQL.hs
+5
-2
AsyncTask.hs
src/Gargantext/API/GraphQL/AsyncTask.hs
+1
-8
IMT.hs
src/Gargantext/API/GraphQL/IMT.hs
+29
-0
Node.hs
src/Gargantext/API/GraphQL/Node.hs
+0
-1
IMT.hs
src/Gargantext/Core/Ext/IMT.hs
+72
-66
No files found.
src/Gargantext/API/GraphQL.hs
View file @
7cc5e33d
...
...
@@ -33,6 +33,7 @@ import Gargantext.API.Admin.Auth.Types (AuthenticatedUser)
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
)
import
Gargantext.API.Prelude
(
HasJobEnv
'
)
import
qualified
Gargantext.API.GraphQL.AsyncTask
as
GQLAT
import
qualified
Gargantext.API.GraphQL.IMT
as
GQLIMT
import
qualified
Gargantext.API.GraphQL.Node
as
GQLNode
import
qualified
Gargantext.API.GraphQL.User
as
GQLUser
import
qualified
Gargantext.API.GraphQL.UserInfo
as
GQLUserInfo
...
...
@@ -61,7 +62,8 @@ import qualified Servant.Auth.Server as SAS
-- | Represents possible GraphQL queries.
data
Query
m
=
Query
{
job_logs
::
GQLAT
.
JobLogArgs
->
m
(
Map
Int
JobLog
)
{
imt_schools
::
GQLIMT
.
SchoolsArgs
->
m
[
GQLIMT
.
School
]
,
job_logs
::
GQLAT
.
JobLogArgs
->
m
(
Map
Int
JobLog
)
,
nodes
::
GQLNode
.
NodeArgs
->
m
[
GQLNode
.
Node
]
,
node_parent
::
GQLNode
.
NodeParentArgs
->
m
[
GQLNode
.
Node
]
,
user_infos
::
GQLUserInfo
.
UserInfoArgs
->
m
[
GQLUserInfo
.
UserInfo
]
...
...
@@ -96,7 +98,8 @@ rootResolver
=>
RootResolver
(
GargM
env
GargError
)
e
Query
Mutation
Undefined
rootResolver
=
RootResolver
{
queryResolver
=
Query
{
job_logs
=
GQLAT
.
resolveJobLogs
{
queryResolver
=
Query
{
imt_schools
=
GQLIMT
.
resolveSchools
,
job_logs
=
GQLAT
.
resolveJobLogs
,
nodes
=
GQLNode
.
resolveNodes
,
node_parent
=
GQLNode
.
resolveNodeParent
,
user_infos
=
GQLUserInfo
.
resolveUserInfos
...
...
src/Gargantext/API/GraphQL/AsyncTask.hs
View file @
7cc5e33d
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
...
...
@@ -9,24 +8,18 @@ import Control.Concurrent.MVar (readMVar)
import
Control.Lens
import
Data.Map
(
Map
)
import
qualified
Data.Map
as
Map
import
Control.Monad.Base
(
liftBase
)
import
Control.Monad.Reader
(
ask
,
liftIO
)
import
Data.Either
(
Either
(
..
))
import
qualified
Data.IntMap.Strict
as
IntMap
import
Data.Maybe
(
Maybe
(
..
),
catMaybes
)
import
Data.Maybe
(
catMaybes
)
import
Data.Morpheus.Types
(
GQLType
,
Resolver
,
ResolverM
,
QUERY
,
lift
)
import
Data.Text
(
Text
)
import
qualified
Data.Text
as
T
import
Gargantext.API.Admin.Orchestrator.Types
(
JobLog
(
..
))
import
Gargantext.API.Prelude
(
GargM
,
GargError
,
HasJobEnv
'
)
import
Gargantext.Core.Mail.Types
(
HasMail
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
(
..
))
import
Gargantext.Database.Prelude
(
HasConnectionPool
,
HasConfig
)
import
Gargantext.Prelude
import
GHC.Generics
(
Generic
)
...
...
src/Gargantext/API/GraphQL/IMT.hs
0 → 100644
View file @
7cc5e33d
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
module
Gargantext.API.GraphQL.IMT
(
School
(
..
)
,
SchoolsArgs
(
..
)
,
resolveSchools
)
where
import
Data.Morpheus.Types
(
GQLType
,
Resolver
,
QUERY
)
import
Gargantext.API.Prelude
(
GargM
,
GargError
)
import
Gargantext.Core.Ext.IMT
(
School
(
..
),
schools
)
import
Gargantext.Prelude
import
GHC.Generics
(
Generic
)
data
SchoolsArgs
=
SchoolsArgs
{
}
deriving
(
Generic
,
GQLType
)
type
GqlM
e
env
=
Resolver
QUERY
e
(
GargM
env
GargError
)
resolveSchools
::
SchoolsArgs
->
GqlM
e
env
[
School
]
resolveSchools
SchoolsArgs
{
}
=
pure
$
schools
src/Gargantext/API/GraphQL/Node.hs
View file @
7cc5e33d
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-}
...
...
src/Gargantext/Core/Ext/IMT.hs
View file @
7cc5e33d
{-# LANGUAGE DeriveAnyClass #-}
{-|
Module : Gargantext.API
Description : Server API
...
...
@@ -21,6 +23,9 @@ import qualified Data.Vector as DV
import
qualified
Data.Map
as
M
import
qualified
Prelude
import
Data.Morpheus.Types
(
GQLType
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Prelude
import
Gargantext.Core.Text.Metrics.Utils
as
Utils
...
...
@@ -29,74 +34,75 @@ import Gargantext.Core.Text.Corpus.Parsers.CSV as CSV
data
School
=
School
{
school_shortName
::
Text
,
school_longName
::
Text
,
school_id
::
Text
}
deriving
(
Show
,
Read
,
Eq
)
}
deriving
(
Generic
,
GQLType
,
Show
,
Read
,
Eq
)
schools
::
[
School
]
schools
=
[
School
{
school_shortName
=
"Mines Albi-Carmaux"
,
school_longName
=
"Mines Albi-Carmaux - École nationale supérieure des Mines d'Albi‐Carmaux"
,
school_id
=
"469216"
}
,
School
{
school_shortName
=
"Mines Alès"
,
school_longName
=
"EMA - École des Mines d'Alès"
,
school_id
=
"6279"
}
,
School
{
school_shortName
=
"Mines Douai"
,
school_longName
=
"Mines Douai EMD - École des Mines de Douai"
,
school_id
=
"224096"
}
,
School
{
school_shortName
=
"Mines Lille"
,
school_longName
=
"Mines Lille - École des Mines de Lille"
,
school_id
=
"144103"
}
,
School
{
school_shortName
=
"IMT Lille Douai"
,
school_longName
=
"IMT Lille Douai"
,
school_id
=
"497330"
}
,
School
{
school_shortName
=
"Mines Nantes"
,
school_longName
=
"Mines Nantes - Mines Nantes"
,
school_id
=
"84538"
}
,
School
{
school_shortName
=
"Télécom Bretagne"
,
school_longName
=
"Télécom Bretagne"
,
school_id
=
"301262"
}
,
School
{
school_shortName
=
"IMT Atlantique"
,
school_longName
=
"IMT Atlantique - IMT Atlantique Bretagne-Pays de la Loire"
,
school_id
=
"481355"
}
,
School
{
school_shortName
=
"Mines Saint-Étienne"
,
school_longName
=
"Mines Saint-Étienne MSE - École des Mines de Saint-Étienne"
,
school_id
=
"29212"
}
,
School
{
school_shortName
=
"Télécom École de Management"
,
school_longName
=
"TEM - Télécom Ecole de Management"
,
school_id
=
"301442"
}
,
School
{
school_shortName
=
"IMT Business School"
,
school_longName
=
"IMT Business School"
,
school_id
=
"542824"
}
,
School
{
school_shortName
=
"Télécom ParisTech"
,
school_longName
=
"Télécom ParisTech"
,
school_id
=
"300362"
}
,
School
{
school_shortName
=
"Télécom SudParis"
,
school_longName
=
"TSP - Télécom SudParis"
,
school_id
=
"352124"
}
,
School
{
school_shortName
=
"ARMINES"
,
school_longName
=
"ARMINES"
,
school_id
=
"300362"
}
,
School
{
school_shortName
=
"Eurecom"
,
school_longName
=
"Eurecom"
,
school_id
=
"421532"
}
,
School
{
school_shortName
=
"Mines ParisTech"
,
school_longName
=
"MINES ParisTech - École nationale supérieure des mines de Paris"
,
school_id
=
"301492"
}
]
schools
=
[
School
{
school_shortName
=
"ARMINES"
,
school_longName
=
"ARMINES"
,
school_id
=
"300104"
}
,
School
{
school_shortName
=
"Eurecom"
,
school_longName
=
"Eurecom"
,
school_id
=
"421532"
}
,
School
{
school_shortName
=
"IMT Atlantique"
,
school_longName
=
"IMT Atlantique - IMT Atlantique Bretagne-Pays de la Loire"
,
school_id
=
"481355"
}
,
School
{
school_shortName
=
"IMT Business School"
,
school_longName
=
"IMT Business School"
,
school_id
=
"542824"
}
,
School
{
school_shortName
=
"IMT Lille Douai"
,
school_longName
=
"IMT Lille Douai"
,
school_id
=
"497330"
}
,
School
{
school_shortName
=
"Mines Albi-Carmaux"
,
school_longName
=
"Mines Albi-Carmaux - École nationale supérieure des Mines d'Albi‐Carmaux"
,
school_id
=
"469216"
}
,
School
{
school_shortName
=
"Mines Alès"
,
school_longName
=
"EMA - École des Mines d'Alès"
,
school_id
=
"6279"
}
,
School
{
school_shortName
=
"Mines Douai"
,
school_longName
=
"Mines Douai EMD - École des Mines de Douai"
,
school_id
=
"224096"
}
,
School
{
school_shortName
=
"Mines Lille"
,
school_longName
=
"Mines Lille - École des Mines de Lille"
,
school_id
=
"144103"
}
,
School
{
school_shortName
=
"Mines Nantes"
,
school_longName
=
"Mines Nantes - Mines Nantes"
,
school_id
=
"84538"
}
,
School
{
school_shortName
=
"Mines ParisTech"
,
school_longName
=
"MINES ParisTech - École nationale supérieure des mines de Paris"
,
school_id
=
"301492"
}
,
School
{
school_shortName
=
"Mines Saint-Étienne"
,
school_longName
=
"Mines Saint-Étienne MSE - École des Mines de Saint-Étienne"
,
school_id
=
"29212"
}
,
School
{
school_shortName
=
"Télécom Bretagne"
,
school_longName
=
"Télécom Bretagne"
,
school_id
=
"301262"
}
,
School
{
school_shortName
=
"Télécom École de Management"
,
school_longName
=
"TEM - Télécom Ecole de Management"
,
school_id
=
"301442"
}
,
School
{
school_shortName
=
"Télécom ParisTech"
,
school_longName
=
"Télécom ParisTech"
,
school_id
=
"300362"
}
,
School
{
school_shortName
=
"Télécom SudParis"
,
school_longName
=
"TSP - Télécom SudParis"
,
school_id
=
"352124"
}
]
mapIdSchool
::
Map
Text
Text
mapIdSchool
=
M
.
fromList
$
Gargantext
.
Prelude
.
map
...
...
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