morpheus-graphql-core 0.22.1 → 0.23.0
raw patch · 3 files changed
+16/−15 lines, 3 filesdep ~morpheus-graphql-testsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: morpheus-graphql-tests
API changes (from Hackage documentation)
Files
- morpheus-graphql-core.cabal +2/−2
- src/Data/Morpheus/Types/Internal/AST/Name.hs +11/−11
- src/Data/Morpheus/Validation/Internal/Value.hs +3/−2
morpheus-graphql-core.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: morpheus-graphql-core-version: 0.22.1+version: 0.23.0 synopsis: Morpheus GraphQL Core description: Build GraphQL APIs with your favorite functional language! category: web, graphql@@ -270,7 +270,7 @@ , hashable >=1.0.0 && <2.0.0 , megaparsec >=7.0.0 && <10.0.0 , morpheus-graphql-core- , morpheus-graphql-tests >=0.22.0 && <0.23.0+ , morpheus-graphql-tests >=0.23.0 && <0.24.0 , mtl >=2.0.0 && <3.0.0 , relude >=0.3.0 && <2.0.0 , scientific >=0.3.6.2 && <0.4.0
src/Data/Morpheus/Types/Internal/AST/Name.hs view
@@ -30,19 +30,11 @@ ( FromJSON, ToJSON (..), )-import Data.Morpheus.Rendering.RenderGQL- ( RenderGQL (..),- fromText,- renderGQL,- )-import Data.Morpheus.Types.Internal.AST.Error- ( Msg (..),- ) #if MIN_VERSION_aeson(2,0,0) import Data.Aeson.Key (Key) import qualified Data.Aeson.Key as A #endif-import qualified Data.Text as T+ #if MIN_VERSION_template_haskell(2,17,0) import Language.Haskell.TH ( Quote,@@ -66,6 +58,15 @@ #endif import Data.Char (isLetter, isNumber) import qualified Data.List as L+import Data.Morpheus.Rendering.RenderGQL+ ( RenderGQL (..),+ fromText,+ renderGQL,+ )+import Data.Morpheus.Types.Internal.AST.Error+ ( Msg (..),+ )+import qualified Data.Text as T import qualified Language.Haskell.TH.Syntax as TH import Relude hiding ( ByteString,@@ -110,8 +111,7 @@ instance NamePacking TH.Name where packName (TH.Name name _) = Name $ T.pack (occName name) where- occName (TH.OccName n) = takeWhile (/= ':') (removeSelector n)- removeSelector x = fromMaybe x (L.stripPrefix "$sel:" x)+ occName (TH.OccName x) = maybe x (takeWhile (/= ':')) (L.stripPrefix "$sel:" x) unpackName = TH.mkName . toString . _unpackName instance NamePacking Text where
src/Data/Morpheus/Validation/Internal/Value.hs view
@@ -151,14 +151,15 @@ | isNullable wrappers = pure Null | otherwise = violation Nothing Null -- Validate LIST+ validateWrapped (TypeList wrappers _) tyCont (List list) = List <$> traverse (validateInputByType wrappers tyCont) list+validateWrapped (TypeList wrappers _) tyCont singleElem =+ List . pure <$> validateInputByType wrappers tyCont singleElem {-- 2. VALIDATE TYPES, all wrappers are already Processed --} {-- VALIDATE OBJECT--} validateWrapped BaseType {} TypeDefinition {typeContent} entryValue = validateUnwrapped typeContent entryValue-{-- 3. THROW ERROR: on invalid values --}-validateWrapped _ _ entryValue = violation Nothing entryValue validateUnwrapped :: ValidateWithDefault ctx schemaS valueS =>