morpheus-graphql-core 0.26.0 → 0.27.0
raw patch · 16 files changed
+169/−136 lines, 16 filesdep ~morpheus-graphql-tests
Dependency ranges changed: morpheus-graphql-tests
Files
- morpheus-graphql-core.cabal +2/−2
- src/Data/Morpheus/Parsing/Internal/Pattern.hs +21/−21
- src/Data/Morpheus/Parsing/Request/Operation.hs +1/−1
- src/Data/Morpheus/Types/Internal/AST/DirectiveLocation.hs +39/−19
- src/Data/Morpheus/Types/Internal/AST/OperationType.hs +29/−17
- src/Data/Morpheus/Types/Internal/AST/Selection.hs +3/−3
- src/Data/Morpheus/Types/Internal/AST/Type.hs +21/−21
- src/Data/Morpheus/Types/Internal/AST/TypeSystem.hs +20/−19
- src/Data/Morpheus/Types/Internal/Validation/SchemaValidator.hs +2/−2
- src/Data/Morpheus/Validation/Document/Validation.hs +11/−11
- src/Data/Morpheus/Validation/Query/Fragment.hs +1/−1
- src/Data/Morpheus/Validation/Query/Selection.hs +9/−9
- src/Data/Morpheus/Validation/Query/UnionSelection.hs +3/−3
- src/Data/Morpheus/Validation/Query/Validation.hs +1/−1
- test/schema/validation/schema-definition/fail/non-object-kind/from-schema/response.json +3/−3
- test/schema/validation/schema-definition/fail/non-object-kind/without-schema/response.json +3/−3
morpheus-graphql-core.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: morpheus-graphql-core-version: 0.26.0+version: 0.27.0 synopsis: Morpheus GraphQL Core description: Build GraphQL APIs with your favorite functional language! category: web, graphql@@ -273,7 +273,7 @@ , hashable >=1.0.0 && <2.0.0 , megaparsec >=7.0.0 && <10.0.0 , morpheus-graphql-core- , morpheus-graphql-tests >=0.26.0 && <0.27.0+ , morpheus-graphql-tests >=0.27.0 && <0.28.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/Parsing/Internal/Pattern.hs view
@@ -198,9 +198,9 @@ parseOperationType :: Parser OperationType parseOperationType = label "OperationType" $- ( (string "query" $> Query)- <|> (string "mutation" $> Mutation)- <|> (string "subscription" $> Subscription)+ ( (string "query" $> OPERATION_QUERY)+ <|> (string "mutation" $> OPERATION_MUTATION)+ <|> (string "subscription" $> OPERATION_SUBSCRIPTION) ) <* ignoredTokens {-# INLINEABLE parseOperationType #-}@@ -211,24 +211,24 @@ "DirectiveLocation" ( choice $ toKeyword- <$> [ FIELD_DEFINITION,- FRAGMENT_DEFINITION,- FRAGMENT_SPREAD,- INLINE_FRAGMENT,- ARGUMENT_DEFINITION,- INTERFACE,- ENUM_VALUE,- INPUT_OBJECT,- INPUT_FIELD_DEFINITION,- SCHEMA,- SCALAR,- OBJECT,- QUERY,- MUTATION,- SUBSCRIPTION,- UNION,- ENUM,- FIELD+ <$> [ LOCATION_FIELD_DEFINITION,+ LOCATION_FRAGMENT_DEFINITION,+ LOCATION_FRAGMENT_SPREAD,+ LOCATION_INLINE_FRAGMENT,+ LOCATION_ARGUMENT_DEFINITION,+ LOCATION_INTERFACE,+ LOCATION_ENUM_VALUE,+ LOCATION_INPUT_OBJECT,+ LOCATION_INPUT_FIELD_DEFINITION,+ LOCATION_SCHEMA,+ LOCATION_SCALAR,+ LOCATION_OBJECT,+ LOCATION_QUERY,+ LOCATION_MUTATION,+ LOCATION_SUBSCRIPTION,+ LOCATION_UNION,+ LOCATION_ENUM,+ LOCATION_FIELD ] ) <* ignoredTokens
src/Data/Morpheus/Parsing/Request/Operation.hs view
@@ -83,7 +83,7 @@ pure ( Operation { operationName = Nothing,- operationType = Query,+ operationType = OPERATION_QUERY, operationArguments = empty, operationDirectives = empty, ..
src/Data/Morpheus/Types/Internal/AST/DirectiveLocation.hs view
@@ -13,25 +13,45 @@ import Prelude (Show (..)) data DirectiveLocation- = QUERY- | MUTATION- | SUBSCRIPTION- | FIELD- | FRAGMENT_DEFINITION- | FRAGMENT_SPREAD- | INLINE_FRAGMENT- | SCHEMA- | SCALAR- | OBJECT- | FIELD_DEFINITION- | ARGUMENT_DEFINITION- | INTERFACE- | UNION- | ENUM- | ENUM_VALUE- | INPUT_OBJECT- | INPUT_FIELD_DEFINITION- deriving (Show, Eq, Lift)+ = LOCATION_QUERY+ | LOCATION_MUTATION+ | LOCATION_SUBSCRIPTION+ | LOCATION_FIELD+ | LOCATION_FRAGMENT_DEFINITION+ | LOCATION_FRAGMENT_SPREAD+ | LOCATION_INLINE_FRAGMENT+ | LOCATION_SCHEMA+ | LOCATION_SCALAR+ | LOCATION_OBJECT+ | LOCATION_FIELD_DEFINITION+ | LOCATION_ARGUMENT_DEFINITION+ | LOCATION_INTERFACE+ | LOCATION_UNION+ | LOCATION_ENUM+ | LOCATION_ENUM_VALUE+ | LOCATION_INPUT_OBJECT+ | LOCATION_INPUT_FIELD_DEFINITION+ deriving (Eq, Lift)++instance Show DirectiveLocation where+ show LOCATION_QUERY = "QUERY"+ show LOCATION_MUTATION = "MUTATION"+ show LOCATION_SUBSCRIPTION = "SUBSCRIPTION"+ show LOCATION_FIELD = "FIELD"+ show LOCATION_FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION"+ show LOCATION_FRAGMENT_SPREAD = "FRAGMENT_SPREAD"+ show LOCATION_INLINE_FRAGMENT = "INLINE_FRAGMENT"+ show LOCATION_SCHEMA = "SCHEMA"+ show LOCATION_SCALAR = "SCALAR"+ show LOCATION_OBJECT = "OBJECT"+ show LOCATION_FIELD_DEFINITION = "FIELD_DEFINITION"+ show LOCATION_ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION"+ show LOCATION_INTERFACE = "INTERFACE"+ show LOCATION_UNION = "UNION"+ show LOCATION_ENUM = "ENUM"+ show LOCATION_ENUM_VALUE = "ENUM_VALUE"+ show LOCATION_INPUT_OBJECT = "INPUT_OBJECT"+ show LOCATION_INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION" instance Msg DirectiveLocation where msg = msg . show
src/Data/Morpheus/Types/Internal/AST/OperationType.hs view
@@ -11,10 +11,10 @@ MUTATION, SUBSCRIPTION, toOperationType,+ isOperationType, ) where -import Data.Char (toLower) import Data.Morpheus.Rendering.RenderGQL ( RenderGQL (..), )@@ -25,39 +25,51 @@ ) import Relude hiding ( ByteString,+ Show, decodeUtf8, intercalate,+ show, )+import Prelude (Show (..)) -type QUERY = 'Query+type QUERY = 'OPERATION_QUERY -type MUTATION = 'Mutation+type MUTATION = 'OPERATION_MUTATION -type SUBSCRIPTION = 'Subscription+type SUBSCRIPTION = 'OPERATION_SUBSCRIPTION data OperationType- = Query- | Subscription- | Mutation+ = OPERATION_QUERY+ | OPERATION_SUBSCRIPTION+ | OPERATION_MUTATION deriving- ( Show,- Eq,+ ( Eq, Lift, Generic,- Hashable+ Hashable,+ Show ) instance RenderGQL OperationType where- renderGQL = fromString . fmap toLower . show+ renderGQL OPERATION_QUERY = "query"+ renderGQL OPERATION_MUTATION = "mutation"+ renderGQL OPERATION_SUBSCRIPTION = "subscription" +isOperationType :: OperationType -> TypeName -> Bool+isOperationType OPERATION_QUERY "Query" = True+isOperationType OPERATION_MUTATION "Mutation" = True+isOperationType OPERATION_SUBSCRIPTION "Subscription" = True+isOperationType _ _ = False+{-# INLINE isOperationType #-}+ toOperationType :: TypeName -> Maybe OperationType-toOperationType "Subscription" = Just Subscription-toOperationType "Mutation" = Just Mutation-toOperationType "Query" = Just Query+toOperationType "Subscription" = Just OPERATION_SUBSCRIPTION+toOperationType "Mutation" = Just OPERATION_MUTATION+toOperationType "Query" = Just OPERATION_QUERY toOperationType _ = Nothing {-# INLINE toOperationType #-} instance Msg OperationType where- msg Query = msg ("query" :: TypeName)- msg Mutation = msg ("mutation" :: TypeName)- msg Subscription = msg ("subscription" :: TypeName)+ msg OPERATION_QUERY = msg ("query" :: TypeName)+ msg OPERATION_MUTATION = msg ("mutation" :: TypeName)+ msg OPERATION_SUBSCRIPTION = msg ("subscription" :: TypeName)
src/Data/Morpheus/Types/Internal/AST/Selection.hs view
@@ -392,8 +392,8 @@ getOperationName = maybe "AnonymousOperation" coerce getOperationDataType :: MonadError GQLError m => Operation s -> Schema VALID -> m (TypeDefinition OBJECT VALID)-getOperationDataType Operation {operationType = Query} lib = pure (query lib)-getOperationDataType Operation {operationType = Mutation, operationPosition} lib =+getOperationDataType Operation {operationType = OPERATION_QUERY} lib = pure (query lib)+getOperationDataType Operation {operationType = OPERATION_MUTATION, operationPosition} lib = maybe (throwError $ mutationIsNotDefined operationPosition) pure (mutation lib)-getOperationDataType Operation {operationType = Subscription, operationPosition} lib =+getOperationDataType Operation {operationType = OPERATION_SUBSCRIPTION, operationPosition} lib = maybe (throwError $ subscriptionIsNotDefined operationPosition) pure (subscription lib)
src/Data/Morpheus/Types/Internal/AST/Type.hs view
@@ -46,27 +46,27 @@ -- Kind ----------------------------------------------------------------------------------- data TypeKind- = KindScalar- | KindObject (Maybe OperationType)- | KindUnion- | KindEnum- | KindInputObject- | KindList- | KindNonNull- | KindInputUnion- | KindInterface+ = KIND_SCALAR+ | KIND_ENUM+ | KIND_OBJECT (Maybe OperationType)+ | KIND_INPUT_OBJECT+ | KIND_UNION+ | KIND_INPUT_UNION+ | KIND_LIST+ | KIND_NON_NULL+ | KIND_INTERFACE deriving (Eq, Show, Lift) instance RenderGQL TypeKind where- renderGQL KindScalar = "SCALAR"- renderGQL KindObject {} = "OBJECT"- renderGQL KindUnion = "UNION"- renderGQL KindInputUnion = "INPUT_OBJECT"- renderGQL KindEnum = "ENUM"- renderGQL KindInputObject = "INPUT_OBJECT"- renderGQL KindList = "LIST"- renderGQL KindNonNull = "NON_NULL"- renderGQL KindInterface = "INTERFACE"+ renderGQL KIND_SCALAR = "SCALAR"+ renderGQL KIND_ENUM = "ENUM"+ renderGQL KIND_OBJECT {} = "OBJECT"+ renderGQL KIND_INPUT_OBJECT = "INPUT_OBJECT"+ renderGQL KIND_UNION = "UNION"+ renderGQL KIND_INPUT_UNION = "INPUT_OBJECT"+ renderGQL KIND_LIST = "LIST"+ renderGQL KIND_NON_NULL = "NON_NULL"+ renderGQL KIND_INTERFACE = "INTERFACE" -- Definitions: -- Strictness:@@ -78,9 +78,9 @@ isResolverType :: t -> Bool instance Strictness TypeKind where- isResolverType (KindObject _) = True- isResolverType KindUnion = True- isResolverType KindInterface = True+ isResolverType (KIND_OBJECT _) = True+ isResolverType KIND_UNION = True+ isResolverType KIND_INTERFACE = True isResolverType _ = False -- TypeWrappers
src/Data/Morpheus/Types/Internal/AST/TypeSystem.hs view
@@ -81,6 +81,7 @@ Rendering, intercalate, newline,+ render, renderEntry, renderMembers, renderObject,@@ -104,10 +105,10 @@ import Data.Morpheus.Types.Internal.AST.Name ( TypeName, isNotSystemTypeName,- unpackName, ) import Data.Morpheus.Types.Internal.AST.OperationType ( OperationType (..),+ isOperationType, toOperationType, ) import Data.Morpheus.Types.Internal.AST.Stage@@ -143,7 +144,6 @@ import Data.Morpheus.Types.Internal.AST.Value ( Value (..), )-import qualified Data.Text as T import Instances.TH.Lift () import Language.Haskell.TH.Syntax (Lift (..)) import Relude hiding@@ -174,7 +174,8 @@ -- scalar ------------------------------------------------------------------ newtype ScalarDefinition = ScalarDefinition- {validateValue :: Value VALID -> Either Token (Value VALID)}+ { validateValue :: Value VALID -> Either Token (Value VALID)+ } instance Eq ScalarDefinition where _ == _ = False@@ -311,9 +312,9 @@ mkSchema types = traverse3 (popByKey types)- ( RootOperationTypeDefinition Query "Query",- RootOperationTypeDefinition Mutation "Mutation",- RootOperationTypeDefinition Subscription "Subscription"+ ( RootOperationTypeDefinition OPERATION_QUERY "Query",+ RootOperationTypeDefinition OPERATION_MUTATION "Mutation",+ RootOperationTypeDefinition OPERATION_SUBSCRIPTION "Subscription" ) >>= defineSchemaWith types @@ -361,7 +362,7 @@ m (Schema s) buildSchema (Nothing, types, dirs) = mkSchema types >>= withDirectives dirs buildSchema (Just schemaDef, types, dirs) =- traverse3 selectOp (Query, Mutation, Subscription)+ traverse3 selectOp (OPERATION_QUERY, OPERATION_MUTATION, OPERATION_SUBSCRIPTION) >>= defineSchemaWith types >>= withDirectives dirs where@@ -625,13 +626,13 @@ kindOf :: TypeDefinition a s -> TypeKind kindOf TypeDefinition {typeName, typeContent} = __kind typeContent where- __kind DataScalar {} = KindScalar- __kind DataEnum {} = KindEnum- __kind DataInputObject {} = KindInputObject- __kind DataObject {} = KindObject (toOperationType typeName)- __kind DataUnion {} = KindUnion- __kind DataInputUnion {} = KindInputUnion- __kind DataInterface {} = KindInterface+ __kind DataScalar {} = KIND_SCALAR+ __kind DataEnum {} = KIND_ENUM+ __kind DataInputObject {} = KIND_INPUT_OBJECT+ __kind DataObject {} = KIND_OBJECT (toOperationType typeName)+ __kind DataUnion {} = KIND_UNION+ __kind DataInputUnion {} = KIND_INPUT_UNION+ __kind DataInterface {} = KIND_INTERFACE defineType :: ( Monad m,@@ -668,7 +669,7 @@ pure (fromAny dt) Just {} -> throwError $- msg (show opType)+ msg (render opType) <> " root type must be Object type if provided, it cannot be " <> msg name _ -> pure Nothing@@ -682,7 +683,7 @@ RootOperationTypeDefinition { rootOperationType, rootOperationTypeDefinitionName = name- } = show rootOperationType == T.unpack (unpackName name)+ } = isOperationType rootOperationType name instance RenderGQL (Schema s) where renderGQL schema@Schema {..} =@@ -694,9 +695,9 @@ | otherwise = [renderSchemaDefinition entries] entries = catMaybes- [ RootOperationTypeDefinition Query . typeName <$> Just query,- RootOperationTypeDefinition Mutation . typeName <$> mutation,- RootOperationTypeDefinition Subscription . typeName <$> subscription+ [ RootOperationTypeDefinition OPERATION_QUERY . typeName <$> Just query,+ RootOperationTypeDefinition OPERATION_MUTATION . typeName <$> mutation,+ RootOperationTypeDefinition OPERATION_SUBSCRIPTION . typeName <$> subscription ] visibleTypes = renderGQL
src/Data/Morpheus/Types/Internal/Validation/SchemaValidator.hs view
@@ -48,7 +48,7 @@ msg, unpackName, )-import Data.Morpheus.Types.Internal.AST.Type (TypeKind (KindObject))+import Data.Morpheus.Types.Internal.AST.Type (TypeKind (KIND_OBJECT)) import Data.Morpheus.Types.Internal.AST.TypeSystem (Schema) import Data.Morpheus.Types.Internal.Config (Config) import Data.Morpheus.Types.Internal.Validation (Scope (..), ScopeKind (TYPE), runValidator)@@ -110,7 +110,7 @@ Scope { position = Nothing, currentTypeName = "Root",- currentTypeKind = KindObject Nothing,+ currentTypeKind = KIND_OBJECT Nothing, currentTypeWrappers = mkBaseType, kind = TYPE, fieldName = "Root",
src/Data/Morpheus/Validation/Document/Validation.hs view
@@ -136,13 +136,13 @@ | otherwise = throwError ("Invalid Name:" <> msg name) typeDirectiveLocation :: TypeContent a b c -> DirectiveLocation-typeDirectiveLocation DataObject {} = OBJECT-typeDirectiveLocation DataInputObject {} = INPUT_OBJECT-typeDirectiveLocation DataScalar {} = SCALAR-typeDirectiveLocation DataEnum {} = ENUM-typeDirectiveLocation DataInputUnion {} = OBJECT-typeDirectiveLocation DataUnion {} = UNION-typeDirectiveLocation DataInterface {} = INTERFACE+typeDirectiveLocation DataObject {} = LOCATION_OBJECT+typeDirectiveLocation DataInputObject {} = LOCATION_INPUT_OBJECT+typeDirectiveLocation DataScalar {} = LOCATION_SCALAR+typeDirectiveLocation DataEnum {} = LOCATION_ENUM+typeDirectiveLocation DataInputUnion {} = LOCATION_OBJECT+typeDirectiveLocation DataUnion {} = LOCATION_UNION+typeDirectiveLocation DataInterface {} = LOCATION_INTERFACE instance TypeCheck (TypeContent TRUE cat) where type TypeContext (TypeContent TRUE cat) = TypeEntity ON_TYPE@@ -180,10 +180,10 @@ directiveLocation :: Proxy cat -> DirectiveLocation instance FieldDirectiveLocation OUT where- directiveLocation _ = FIELD_DEFINITION+ directiveLocation _ = LOCATION_FIELD_DEFINITION instance FieldDirectiveLocation IN where- directiveLocation _ = INPUT_FIELD_DEFINITION+ directiveLocation _ = LOCATION_INPUT_FIELD_DEFINITION instance TypeCheck DirectiveDefinition where typeCheck DirectiveDefinition {directiveDefinitionArgs = arguments, ..} =@@ -201,7 +201,7 @@ fieldName fieldType <$> traverse checkArgumentDefaultValue fieldContent- <*> validateDirectives ARGUMENT_DEFINITION fieldDirectives+ <*> validateDirectives LOCATION_ARGUMENT_DEFINITION fieldDirectives ) where checkArgumentDefaultValue (DefaultInputValue value) =@@ -221,7 +221,7 @@ type TypeContext DataEnumValue = TypeEntity ON_TYPE typeCheck DataEnumValue {enumDirectives = directives, ..} = DataEnumValue enumDescription enumName- <$> validateDirectives ENUM_VALUE directives+ <$> validateDirectives LOCATION_ENUM_VALUE directives instance TypeCheck (UnionMember cat) where type TypeContext (UnionMember cat) = TypeEntity ON_TYPE
src/Data/Morpheus/Validation/Query/Fragment.hs view
@@ -86,7 +86,7 @@ validateFragments :: (Fragment RAW -> FragmentValidator RAW (SelectionSet VALID)) -> FragmentValidator RAW (Fragments VALID)-validateFragments f = askFragments >>= traverse (onlyValidateFrag FRAGMENT_DEFINITION f)+validateFragments f = askFragments >>= traverse (onlyValidateFrag LOCATION_FRAGMENT_DEFINITION f) onlyValidateFrag :: DirectiveLocation ->
src/Data/Morpheus/Validation/Query/Selection.hs view
@@ -32,7 +32,7 @@ ) import Data.Morpheus.Types.Internal.AST ( Arguments,- DirectiveLocation (FIELD, FRAGMENT_SPREAD, INLINE_FRAGMENT, MUTATION, QUERY, SUBSCRIPTION),+ DirectiveLocation (..), Directives, FieldDefinition (..), FieldName,@@ -95,7 +95,7 @@ selectionsWithoutTypename = filter (("__typename" /=) . keyOf) . toList singleTopLevelSelection :: Operation RAW -> SelectionSet VALID -> SelectionValidator ()-singleTopLevelSelection Operation {operationType = Subscription, operationName} selSet =+singleTopLevelSelection Operation {operationType = OPERATION_SUBSCRIPTION, operationName} selSet = case selectionsWithoutTypename selSet of (_ : (x : xs)) -> throwErrors $ fmap (singleTopLevelSelectionError operationName) (x :| xs) _ -> pure ()@@ -139,9 +139,9 @@ } toDirectiveLocation :: OperationType -> DirectiveLocation-toDirectiveLocation Subscription = SUBSCRIPTION-toDirectiveLocation Mutation = MUTATION-toDirectiveLocation Query = QUERY+toDirectiveLocation OPERATION_SUBSCRIPTION = LOCATION_SUBSCRIPTION+toDirectiveLocation OPERATION_MUTATION = LOCATION_MUTATION+toDirectiveLocation OPERATION_QUERY = LOCATION_QUERY processSelectionDirectives :: DirectiveLocation ->@@ -180,7 +180,7 @@ validateSelection :: ValidateFragmentSelection s => TypeDefinition IMPLEMENTABLE VALID -> Selection RAW -> FragmentValidator s (Maybe (SelectionSet VALID)) validateSelection typeDef Selection {..} = withScope (setSelection typeDef selectionRef) $- processSelectionDirectives FIELD selectionDirectives validateContent+ processSelectionDirectives LOCATION_FIELD selectionDirectives validateContent where selectionRef = Ref selectionName selectionPosition validateContent directives = do@@ -194,11 +194,11 @@ } pure $ singleton (keyOf selection) selection validateSelection typeDef (Spread dirs ref) =- processSelectionDirectives FRAGMENT_SPREAD dirs $+ processSelectionDirectives LOCATION_FRAGMENT_SPREAD dirs $ const $ validateSpreadSelection typeDef ref validateSelection typeDef (InlineFragment fragment@Fragment {fragmentDirectives}) =- processSelectionDirectives INLINE_FRAGMENT fragmentDirectives $+ processSelectionDirectives LOCATION_INLINE_FRAGMENT fragmentDirectives $ const $ validateInlineFragmentSelection typeDef fragment @@ -218,7 +218,7 @@ FragmentValidator s (SelectionSet VALID) validateInlineFragmentSelection typeDef x = do types <- possibleTypes typeDef <$> asks schema- fragmentSelection <$> validateFragment INLINE_FRAGMENT validateFragmentSelection types x+ fragmentSelection <$> validateFragment LOCATION_INLINE_FRAGMENT validateFragmentSelection types x selectSelectionField :: Ref FieldName ->
src/Data/Morpheus/Validation/Query/UnionSelection.hs view
@@ -25,7 +25,7 @@ selectOr, startHistory, )-import Data.Morpheus.Types.Internal.AST.DirectiveLocation (DirectiveLocation (FRAGMENT_SPREAD, INLINE_FRAGMENT))+import Data.Morpheus.Types.Internal.AST.DirectiveLocation (DirectiveLocation (..)) import Data.Morpheus.Types.Internal.AST.Name (TypeName) import Data.Morpheus.Types.Internal.AST.Selection ( Fragment (..),@@ -72,10 +72,10 @@ FragmentValidator s (Either UnionTag (Selection RAW)) splitFragment _ _ x@Selection {} = pure (Right x) splitFragment f types (Spread dirs ref) = do- _ <- validateDirectives FRAGMENT_SPREAD dirs+ _ <- validateDirectives LOCATION_FRAGMENT_SPREAD dirs Left <$> validateSpread f (typeName <$> types) ref splitFragment f types (InlineFragment fragment@Fragment {..}) = do- _ <- validateDirectives INLINE_FRAGMENT fragmentDirectives+ _ <- validateDirectives LOCATION_INLINE_FRAGMENT fragmentDirectives Left . UnionTag fragmentType <$> (castFragmentType Nothing fragmentPosition (typeName <$> types) fragment >>= f)
src/Data/Morpheus/Validation/Query/Validation.hs view
@@ -106,7 +106,7 @@ Scope { kind = SELECTION, currentTypeName = "Root",- currentTypeKind = KindObject Nothing,+ currentTypeKind = KIND_OBJECT Nothing, currentTypeWrappers = mkBaseType, fieldName = "Root", position = Just operationPosition,
test/schema/validation/schema-definition/fail/non-object-kind/from-schema/response.json view
@@ -1,11 +1,11 @@ [ {- "message": "Mutation root type must be Object type if provided, it cannot be \"MyUnion\""+ "message": "mutation root type must be Object type if provided, it cannot be \"MyUnion\"" }, {- "message": "Query root type must be Object type if provided, it cannot be \"MyType\""+ "message": "query root type must be Object type if provided, it cannot be \"MyType\"" }, {- "message": "Subscription root type must be Object type if provided, it cannot be \"MyEnum\""+ "message": "subscription root type must be Object type if provided, it cannot be \"MyEnum\"" } ]
test/schema/validation/schema-definition/fail/non-object-kind/without-schema/response.json view
@@ -1,11 +1,11 @@ [ {- "message": "Mutation root type must be Object type if provided, it cannot be \"Mutation\""+ "message": "mutation root type must be Object type if provided, it cannot be \"Mutation\"" }, {- "message": "Query root type must be Object type if provided, it cannot be \"Query\""+ "message": "query root type must be Object type if provided, it cannot be \"Query\"" }, {- "message": "Subscription root type must be Object type if provided, it cannot be \"Subscription\""+ "message": "subscription root type must be Object type if provided, it cannot be \"Subscription\"" } ]