forked from OSS/graphql
Compare commits
1 Commits
59aa010f0b
...
4063d48a37
Author | SHA1 | Date | |
---|---|---|---|
4063d48a37 |
@ -618,10 +618,6 @@ noUndefinedVariablesRule =
|
|||||||
, "\"."
|
, "\"."
|
||||||
]
|
]
|
||||||
|
|
||||||
-- Used to find the difference between defined and used variables. The first
|
|
||||||
-- argument are variables defined in the operation, the second argument are
|
|
||||||
-- variables used in the query. It should return the difference between these
|
|
||||||
-- 2 sets.
|
|
||||||
type UsageDifference
|
type UsageDifference
|
||||||
= HashMap Full.Name [Full.Location]
|
= HashMap Full.Name [Full.Location]
|
||||||
-> HashMap Full.Name [Full.Location]
|
-> HashMap Full.Name [Full.Location]
|
||||||
|
@ -18,7 +18,7 @@ import Language.GraphQL.Type
|
|||||||
import qualified Language.GraphQL.Type.In as In
|
import qualified Language.GraphQL.Type.In as In
|
||||||
import qualified Language.GraphQL.Type.Out as Out
|
import qualified Language.GraphQL.Type.Out as Out
|
||||||
import Language.GraphQL.Validate
|
import Language.GraphQL.Validate
|
||||||
import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain, xit)
|
import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain)
|
||||||
import Text.Megaparsec (parse, errorBundlePretty)
|
import Text.Megaparsec (parse, errorBundlePretty)
|
||||||
|
|
||||||
petSchema :: Schema IO
|
petSchema :: Schema IO
|
||||||
@ -560,7 +560,7 @@ spec =
|
|||||||
}
|
}
|
||||||
in validate queryString `shouldBe` [expected]
|
in validate queryString `shouldBe` [expected]
|
||||||
|
|
||||||
context "noUnusedVariablesRule" $ do
|
context "noUnusedVariablesRule" $
|
||||||
it "rejects unused variables" $
|
it "rejects unused variables" $
|
||||||
let queryString = [gql|
|
let queryString = [gql|
|
||||||
query variableUnused($atOtherHomes: Boolean) {
|
query variableUnused($atOtherHomes: Boolean) {
|
||||||
@ -577,16 +577,6 @@ spec =
|
|||||||
}
|
}
|
||||||
in validate queryString `shouldBe` [expected]
|
in validate queryString `shouldBe` [expected]
|
||||||
|
|
||||||
xit "detects variables in properties of input objects" $
|
|
||||||
let queryString = [gql|
|
|
||||||
query withVar ($name: String!) {
|
|
||||||
findDog (complex: { name: $name }) {
|
|
||||||
name
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|]
|
|
||||||
in validate queryString `shouldBe` []
|
|
||||||
|
|
||||||
context "uniqueInputFieldNamesRule" $
|
context "uniqueInputFieldNamesRule" $
|
||||||
it "rejects duplicate fields in input objects" $
|
it "rejects duplicate fields in input objects" $
|
||||||
let queryString = [gql|
|
let queryString = [gql|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user