]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/API/GraphQL/Utils.hs
[VERSION] +1 to 0.0.4.9.9.6
[gargantext.git] / src / Gargantext / API / GraphQL / Utils.hs
1 module Gargantext.API.GraphQL.Utils where
2
3 import Data.Morpheus.Types (GQLTypeOptions, fieldLabelModifier)
4 import qualified Data.Text as T
5 import Gargantext.Core.Utils.Prefix (unCapitalize, dropPrefix)
6 import Gargantext.Prelude
7
8 unPrefix :: T.Text -> GQLTypeOptions -> GQLTypeOptions
9 unPrefix prefix options = options { fieldLabelModifier = nflm }
10 where
11 nflm label = unCapitalize $ dropPrefix (T.unpack prefix) $ ( fieldLabelModifier options ) label