1 module Gargantext.API.GraphQL.Utils where
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
8 unPrefix :: T.Text -> GQLTypeOptions -> GQLTypeOptions
9 unPrefix prefix options = options { fieldLabelModifier = nflm }
11 nflm label = unCapitalize $ dropPrefix (T.unpack prefix) $ ( fieldLabelModifier options ) label