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
5c37bca9
Commit
5c37bca9
authored
Apr 06, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/client-graphql-endpoint' into dev-merge
parents
920d3ec4
8fe83448
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
Client.hs
src/Gargantext/API/Client.hs
+10
-0
GraphQL.hs
src/Gargantext/API/GraphQL.hs
+4
-0
No files found.
src/Gargantext/API/Client.hs
View file @
5c37bca9
{-# OPTIONS_GHC -freduction-depth=0 #-}
{-# OPTIONS_GHC -freduction-depth=0 #-}
{-# OPTIONS_GHC -O0 #-}
{-# OPTIONS_GHC -O0 #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Client
where
module
Gargantext.API.Client
where
import
Data.Int
import
Data.Int
import
Data.Maybe
import
Data.Maybe
import
Data.Map
(
Map
)
import
Data.Map
(
Map
)
import
Data.Morpheus.Types.IO
(
GQLRequest
,
GQLResponse
)
import
Data.Proxy
import
Data.Proxy
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Time.Clock
import
Data.Time.Clock
...
@@ -15,6 +17,7 @@ import Gargantext.API.Admin.Auth.Types hiding (Token)
...
@@ -15,6 +17,7 @@ import Gargantext.API.Admin.Auth.Types hiding (Token)
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.API.Admin.Orchestrator.Types
import
Gargantext.API.Count
import
Gargantext.API.Count
import
Gargantext.API.EKG
import
Gargantext.API.EKG
import
qualified
Gargantext.API.GraphQL
as
GraphQL
import
Gargantext.API.HashedResponse
import
Gargantext.API.HashedResponse
import
Gargantext.API.Ngrams
as
Ngrams
import
Gargantext.API.Ngrams
as
Ngrams
import
Gargantext.API.Ngrams.NgramsTree
import
Gargantext.API.Ngrams.NgramsTree
...
@@ -420,6 +423,13 @@ getMetricsSample :: ClientM Sample
...
@@ -420,6 +423,13 @@ getMetricsSample :: ClientM Sample
-- | open @<backend:port\/ekg\/index.html@ to see a list of metrics
-- | open @<backend:port\/ekg\/index.html@ to see a list of metrics
getMetricSample
::
[
Text
]
->
ClientM
Value
getMetricSample
::
[
Text
]
->
ClientM
Value
-- * graphql api
postGraphQL
::
Token
->
GQLRequest
->
ClientM
GQLResponse
postGraphQL
=
client
(
fstEndpoint
(
flatten
GraphQL
.
gqapi
))
where
fstEndpoint
::
Proxy
(
a
:<|>
b
)
->
Proxy
a
fstEndpoint
_
=
Proxy
-- * unpacking of client functions to derive all the individual clients
-- * unpacking of client functions to derive all the individual clients
clientApi
::
Client
ClientM
(
Flat
GargAPI
)
clientApi
::
Client
ClientM
(
Flat
GargAPI
)
...
...
src/Gargantext/API/GraphQL.hs
View file @
5c37bca9
...
@@ -29,6 +29,7 @@ import Data.Morpheus.Types
...
@@ -29,6 +29,7 @@ import Data.Morpheus.Types
,
RootResolver
(
..
)
,
RootResolver
(
..
)
,
Undefined
(
..
)
,
Undefined
(
..
)
)
)
import
Data.Proxy
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
)
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
'
)
...
@@ -136,6 +137,9 @@ type Playground = Get '[HTML] ByteString
...
@@ -136,6 +137,9 @@ type Playground = Get '[HTML] ByteString
type
API
=
SA
.
Auth
'[
S
A
.
JWT
,
SA
.
Cookie
]
AuthenticatedUser
type
API
=
SA
.
Auth
'[
S
A
.
JWT
,
SA
.
Cookie
]
AuthenticatedUser
:>
"gql"
:>
(
GQAPI
:<|>
Playground
)
:>
"gql"
:>
(
GQAPI
:<|>
Playground
)
gqapi
::
Proxy
API
gqapi
=
Proxy
-- serveEndpoint ::
-- serveEndpoint ::
-- ( SubApp ServerApp e
-- ( SubApp ServerApp e
-- , PubApp e
-- , PubApp e
...
...
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