Commit 76e614dd authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[graphql] some more graphql work

parent 64e4f3d1
module Gargantext.API.GraphQL.Utils where
import Data.Morpheus.Types (GQLTypeOptions, fieldLabelModifier)
import qualified Data.Text as T
import Gargantext.Core.Utils.Prefix (unCapitalize, dropPrefix)
import Gargantext.Prelude
unPrefix :: T.Text -> GQLTypeOptions -> GQLTypeOptions
unPrefix prefix gqlto = fieldLabelModifier gqlto nflm
where
nflm label = unCapitalize $ dropPrefix (T.unpack prefix) label
...@@ -25,11 +25,12 @@ module Gargantext.Database.Admin.Types.Hyperdata.User ...@@ -25,11 +25,12 @@ module Gargantext.Database.Admin.Types.Hyperdata.User
where where
import Data.Morpheus.Types (GQLType(typeOptions), defaultTypeOptions) import Data.Morpheus.Types (GQLType(typeOptions), defaultTypeOptions)
import Gargantext.Prelude import qualified Gargantext.API.GraphQL.Utils as GAGU
import Gargantext.Core (Lang(..)) import Gargantext.Core (Lang(..))
import Gargantext.Database.Admin.Types.Hyperdata.Prelude import Gargantext.Database.Admin.Types.Hyperdata.Prelude
import Gargantext.Database.Admin.Types.Hyperdata.Contact import Gargantext.Database.Admin.Types.Hyperdata.Contact
import Gargantext.Database.Admin.Types.Node (DocumentId) import Gargantext.Database.Admin.Types.Node (DocumentId)
import Gargantext.Prelude
-- import Gargantext.Database.Schema.Node -- (Node(..)) -- import Gargantext.Database.Schema.Node -- (Node(..))
...@@ -40,8 +41,7 @@ data HyperdataUser = ...@@ -40,8 +41,7 @@ data HyperdataUser =
} deriving (Eq, Show, Generic) } deriving (Eq, Show, Generic)
instance GQLType HyperdataUser where instance GQLType HyperdataUser where
typeOptions _ = defaultTypeOptions typeOptions _ = GAGU.unPrefix "_hu_" defaultTypeOptions
{ fieldLabelModifier = unCapitalize . dropPrefix "_hu_" }
data HyperdataPrivate = data HyperdataPrivate =
HyperdataPrivate { _hpr_password :: !Text HyperdataPrivate { _hpr_password :: !Text
......
...@@ -87,9 +87,13 @@ extra-deps: ...@@ -87,9 +87,13 @@ extra-deps:
- accelerate-arithmetic-1.0.0.1@sha256:555639232aa5cad411e89247b27871d09352b987a754230a288c690b6de6d888,2096 - accelerate-arithmetic-1.0.0.1@sha256:555639232aa5cad411e89247b27871d09352b987a754230a288c690b6de6d888,2096
- git: https://github.com/morpheusgraphql/morpheus-graphql.git - git: https://github.com/morpheusgraphql/morpheus-graphql.git
commit: 8dacc7cf81dec06225f420c9cabd1d8d3119019d commit: 339ee745049febbf2e7fd6fabf1e01afab19d0a9
subdirs: subdirs:
- .
- morpheus-graphql-app
- morpheus-graphql-core
- morpheus-graphql-code-gen - morpheus-graphql-code-gen
- morpheus-graphql-subscriptions
# Others dependencies (using stack resolver) # Others dependencies (using stack resolver)
- constraints-extras-0.3.1.0@sha256:12016ebb91ad5ed2c82bf7e48c6bd6947d164d33c9dca5ac3965de1bb6c780c0,1777 - constraints-extras-0.3.1.0@sha256:12016ebb91ad5ed2c82bf7e48c6bd6947d164d33c9dca5ac3965de1bb6c780c0,1777
......
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