Commit c74cc6cf authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Fix GraphQL bonus types (and fixes tests)

This commit fixes those GQL types which were defined as an empty
record, as this was rejected in the latest versions of
`morpheus-graphql`.
parent c6cf6b55
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE DerivingStrategies #-}
module Gargantext.API.GraphQL.IMT module Gargantext.API.GraphQL.IMT
( School(..) ( School(..)
...@@ -13,10 +13,11 @@ import Gargantext.API.GraphQL.Types ...@@ -13,10 +13,11 @@ import Gargantext.API.GraphQL.Types
import Gargantext.Core.Ext.IMT (School(..), schools) import Gargantext.Core.Ext.IMT (School(..), schools)
import Gargantext.Prelude import Gargantext.Prelude
data SchoolsArgs newtype SchoolsArgs
= SchoolsArgs = SchoolsArgs ()
{ } deriving (Generic, GQLType) deriving stock (Generic)
deriving anyclass (GQLType)
resolveSchools resolveSchools
:: SchoolsArgs -> GqlM e env [School] :: SchoolsArgs -> GqlM e env [School]
resolveSchools SchoolsArgs { } = pure $ schools resolveSchools (SchoolsArgs ()) = pure $ schools
{-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DuplicateRecordFields #-} {-# LANGUAGE DerivingStrategies #-}
module Gargantext.API.GraphQL.NLP module Gargantext.API.GraphQL.NLP
( Lang(..) ( Lang(..)
...@@ -18,9 +18,10 @@ import Gargantext.Prelude ...@@ -18,9 +18,10 @@ import Gargantext.Prelude
import Protolude import Protolude
import qualified Data.Map.Strict as Map import qualified Data.Map.Strict as Map
data LanguagesArgs newtype LanguagesArgs
= LanguagesArgs = LanguagesArgs ()
{ } deriving (Generic, GQLType) deriving stock (Generic)
deriving anyclass (GQLType)
type LanguagesMap = Map.Map Lang NLPServer type LanguagesMap = Map.Map Lang NLPServer
...@@ -33,7 +34,7 @@ data NLPServer = NLPServer ...@@ -33,7 +34,7 @@ data NLPServer = NLPServer
resolveLanguages resolveLanguages
:: HasNLPServer env => LanguagesArgs -> GqlM e env LanguagesMap :: HasNLPServer env => LanguagesArgs -> GqlM e env LanguagesMap
resolveLanguages LanguagesArgs { } = do resolveLanguages ( LanguagesArgs () ) = do
-- pure $ allLangs -- pure $ allLangs
lift $ do lift $ do
ns <- view nlpServer ns <- view nlpServer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment