diff options
| author | Eugen Wissner <belka@caraus.de> | 2019-10-11 23:28:55 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2019-10-11 23:28:55 +0200 |
| commit | 37254c8c9532794ed41570ef8c646c41e7044f2c (patch) | |
| tree | 649c872813bd80a582a4a3a3bdf821ad282e9791 /tests/Test | |
| parent | 856efc5d256449d9282f6547bb5f677d0a7fe482 (diff) | |
| download | graphql-37254c8c9532794ed41570ef8c646c41e7044f2c.tar.gz | |
Inline fragments without type
Fixes #11.
Diffstat (limited to 'tests/Test')
| -rw-r--r-- | tests/Test/FragmentSpec.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/Test/FragmentSpec.hs b/tests/Test/FragmentSpec.hs index 189306d..337db7e 100644 --- a/tests/Test/FragmentSpec.hs +++ b/tests/Test/FragmentSpec.hs @@ -59,3 +59,25 @@ spec = describe "Inline fragment executor" $ do ] ] in actual `shouldBe` expected + + it "embeds inline fragments without type" $ do + let query = [r|{ + garment { + circumference + ... { + size + } + } + }|] + resolvers = Schema.object "garment" $ return [circumference, size] + + actual <- graphql (resolvers :| []) query + let expected = object + [ "data" .= object + [ "garment" .= object + [ "circumference" .= (60 :: Int) + , "size" .= ("L" :: Text) + ] + ] + ] + in actual `shouldBe` expected |
