From 9bfa2aa7e8a72c9cc08743152a96d18312625712 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 24 Sep 2020 05:47:31 +0200 Subject: Validate input fields have unique names --- src/Language/GraphQL/AST/Encoder.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Language/GraphQL/AST/Encoder.hs') diff --git a/src/Language/GraphQL/AST/Encoder.hs b/src/Language/GraphQL/AST/Encoder.hs index 176a897..011527a 100644 --- a/src/Language/GraphQL/AST/Encoder.hs +++ b/src/Language/GraphQL/AST/Encoder.hs @@ -220,8 +220,8 @@ fromConstValue (ConstEnum x) = Enum x fromConstValue (ConstList x) = List $ fromConstValue <$> x fromConstValue (ConstObject x) = Object $ fromConstObjectField <$> x where - fromConstObjectField (ObjectField key value') = - ObjectField key $ fromConstValue value' + fromConstObjectField (ObjectField key value' location) = + ObjectField key (fromConstValue value') location booleanValue :: Bool -> Lazy.Text booleanValue True = "true" @@ -290,7 +290,7 @@ objectValue formatter = intercalate $ objectField formatter . fmap f objectField :: Formatter -> ObjectField Value -> Lazy.Text -objectField formatter (ObjectField name value') = +objectField formatter (ObjectField name value' _) = Lazy.Text.fromStrict name <> colon formatter <> value formatter value' -- | Converts a 'Type' a type into a string. -- cgit v1.2.3