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
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
39b1d756
Commit
39b1d756
authored
Jun 16, 2025
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '471-dev-fix-get-contexts-for-ngrams' into 'dev'
[graphql] get contexts for ngrams fix See merge request
!416
parents
70edc60b
495436ed
Pipeline
#7682
passed with stages
in 90 minutes and 30 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
GraphQL.hs
src/Gargantext/API/GraphQL.hs
+0
-1
Context.hs
src/Gargantext/API/GraphQL/Context.hs
+5
-5
NodeContext.hs
src/Gargantext/Database/Query/Table/NodeContext.hs
+2
-2
No files found.
src/Gargantext/API/GraphQL.hs
View file @
39b1d756
...
...
@@ -15,7 +15,6 @@ Portability : POSIX
{-# LANGUAGE KindSignatures #-}
-- for use of Endpoint (name :: Symbol)
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PartialTypeSignatures #-}
-- to automatically use suggested type hole signatures during compilation
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.GraphQL
where
...
...
src/Gargantext/API/GraphQL/Context.hs
View file @
39b1d756
...
...
@@ -22,8 +22,7 @@ import Data.Morpheus.Types
,
ResolverM
,
QUERY
)
import
Data.Text
(
pack
,
unpack
)
import
Data.Text
qualified
as
Text
import
Data.Text
(
pack
)
import
Data.Time.Format.ISO8601
(
iso8601Show
)
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
)
import
Gargantext.API.Auth.PolicyCheck
(
nodeWriteChecks
,
AccessPolicyManager
)
...
...
@@ -97,7 +96,7 @@ data ContextsForNgramsArgs
=
ContextsForNgramsArgs
{
corpus_id
::
Int
,
ngrams_terms
::
[
Text
]
,
and_logic
::
Text
,
and_logic
::
Bool
}
deriving
(
Generic
,
GQLType
)
data
NodeContextCategoryMArgs
=
NodeContextCategoryMArgs
...
...
@@ -153,9 +152,10 @@ dbNodeContext context_id node_id = do
-- | Returns list of `ContextGQL` for given ngrams in given corpus id.
dbContextForNgrams
::
(
IsDBEnvExtra
env
)
=>
Int
->
[
Text
]
->
Text
->
GqlM
e
env
[
ContextGQL
]
=>
Int
->
[
Text
]
->
Bool
->
GqlM
e
env
[
ContextGQL
]
dbContextForNgrams
node_id
ngrams_terms
and_logic
=
do
contextsForNgramsTerms
<-
lift
$
runDBQuery
$
getContextsForNgramsTerms
(
UnsafeMkNodeId
node_id
)
ngrams_terms
(
readMaybe
$
unpack
$
Text
.
toTitle
and_logic
)
contextsForNgramsTerms
<-
lift
$
runDBQuery
$
getContextsForNgramsTerms
(
UnsafeMkNodeId
node_id
)
ngrams_terms
and_logic
--lift $ printDebug "[dbContextForNgrams] contextsForNgramsTerms" contextsForNgramsTerms
pure
$
toContextGQL
<$>
contextsForNgramsTerms
...
...
src/Gargantext/Database/Query/Table/NodeContext.hs
View file @
39b1d756
...
...
@@ -151,9 +151,9 @@ data ContextForNgramsTerms =
getContextsForNgramsTerms
::
HasNodeError
err
=>
NodeId
->
[
Text
]
->
Maybe
Bool
->
Bool
->
DBQuery
err
x
[
ContextForNgramsTerms
]
getContextsForNgramsTerms
cId
ngramsTerms
(
Just
True
)
=
do
getContextsForNgramsTerms
cId
ngramsTerms
True
=
do
let
terms_length
=
length
ngramsTerms
res
<-
mkPGQuery
query
(
cId
,
PGS
.
In
ngramsTerms
,
terms_length
)
pure
$
(
\
(
_cfnt_nodeId
...
...
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