forked from OSS/graphql
Add test for introspection as subscription root
Add a pending test checking that an introspection field cannot be subscription root.
This commit is contained in:
parent
27a5a0b44e
commit
2dcefff76a
@ -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\
|
||||
|
Loading…
Reference in New Issue
Block a user