]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/API/GraphQL/NLP.hs
Merge remote-tracking branch 'origin/184-dev-add-support-for-multiple-languages-in...
[gargantext.git] / src / Gargantext / API / GraphQL / NLP.hs
1 {-# LANGUAGE DeriveAnyClass #-}
2 {-# LANGUAGE DuplicateRecordFields #-}
3
4 module Gargantext.API.GraphQL.NLP
5 ( Lang(..)
6 , LanguagesArgs(..)
7 , resolveLanguages
8 )
9 where
10
11 import Data.Morpheus.Types
12 ( GQLType
13 , Resolver
14 , QUERY
15 )
16 import Gargantext.API.Prelude (GargM, GargError)
17 import Gargantext.Core (Lang(..), allLangs)
18 import Gargantext.Prelude
19 import GHC.Generics (Generic)
20
21 data LanguagesArgs
22 = LanguagesArgs
23 { } deriving (Generic, GQLType)
24
25 type GqlM e env = Resolver QUERY e (GargM env GargError)
26
27 resolveLanguages
28 :: LanguagesArgs -> GqlM e env [Lang]
29 resolveLanguages LanguagesArgs { } = pure $ allLangs