diff --git a/tests/Language/GraphQL/Validate/RulesSpec.hs b/tests/Language/GraphQL/Validate/RulesSpec.hs index 02f2cde..af3b38e 100644 --- a/tests/Language/GraphQL/Validate/RulesSpec.hs +++ b/tests/Language/GraphQL/Validate/RulesSpec.hs @@ -18,7 +18,7 @@ import qualified Language.GraphQL.AST.DirectiveLocation as DirectiveLocation import qualified Language.GraphQL.Type.In as In import qualified Language.GraphQL.Type.Out as Out import Language.GraphQL.Validate -import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain) +import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain, xit) import Text.Megaparsec (parse, errorBundlePretty) petSchema :: Schema IO @@ -206,6 +206,18 @@ spec = } in validate queryString `shouldContain` [expected] + xit "rejects an introspection field as the subscription root" $ + let queryString = "subscription sub {\n\ + \ __typename\n\ + \}" + expected = Error + { message = + "Subscription \"sub\" must select only one top \ + \level field." + , locations = [AST.Location 1 1] + } + in validate queryString `shouldContain` [expected] + it "rejects multiple subscription root fields coming from a fragment" $ let queryString = "subscription sub {\n\ \ ...multipleSubscriptions\n\