diff options
| author | Eugen Wissner <belka@caraus.de> | 2020-01-05 07:42:04 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2020-01-13 08:21:02 +0100 |
| commit | 8efb08fda157770afb836537b27c2cd55042b706 (patch) | |
| tree | a4207ea264e5268c8c840ffb471b56d7d9687ec5 /tests/Language/GraphQL/AST | |
| parent | d9a2937b55b3f9c55ac42b1968b62888d916dace (diff) | |
| download | graphql-8efb08fda157770afb836537b27c2cd55042b706.tar.gz | |
Parse ObjectDefinition
Diffstat (limited to 'tests/Language/GraphQL/AST')
| -rw-r--r-- | tests/Language/GraphQL/AST/ParserSpec.hs | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/tests/Language/GraphQL/AST/ParserSpec.hs b/tests/Language/GraphQL/AST/ParserSpec.hs index c51fa57..8d6b576 100644 --- a/tests/Language/GraphQL/AST/ParserSpec.hs +++ b/tests/Language/GraphQL/AST/ParserSpec.hs @@ -28,20 +28,44 @@ spec = describe "Parser" $ do it "accepts two required arguments" $ parse document "" `shouldSucceedOn` [r| mutation auth($username: String!, $password: String!){ - test + test }|] it "accepts two string arguments" $ parse document "" `shouldSucceedOn` [r| mutation auth{ - test(username: "username", password: "password") + test(username: "username", password: "password") }|] it "accepts two block string arguments" $ parse document "" `shouldSucceedOn` [r| mutation auth{ - test(username: """username""", password: """password""") + test(username: """username""", password: """password""") }|] it "parses minimal schema definition" $ parse document "" `shouldSucceedOn` [r|schema { query: Query }|] + + it "parses minimal scalar definition" $ + parse document "" `shouldSucceedOn` [r|scalar Time|] + + it "parses ImplementsInterfaces" $ + parse document "" `shouldSucceedOn` [r| + type Person implements NamedEntity & ValuedEntity { + name: String + } + |] + + it "parses a type without ImplementsInterfaces" $ + parse document "" `shouldSucceedOn` [r| + type Person { + name: String + } + |] + + it "parses ArgumentsDefinition in an ObjectDefinition" $ + parse document "" `shouldSucceedOn` [r| + type Person { + name(first: String, last: String): String + } + |] |
