summaryrefslogtreecommitdiff
path: root/src/Language
diff options
context:
space:
mode:
Diffstat (limited to 'src/Language')
-rw-r--r--src/Language/GraphQL/JSON.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Language/GraphQL/JSON.hs b/src/Language/GraphQL/JSON.hs
index bdbc4f4..2a59e7b 100644
--- a/src/Language/GraphQL/JSON.hs
+++ b/src/Language/GraphQL/JSON.hs
@@ -1,7 +1,12 @@
+{- This Source Code Form is subject to the terms of the Mozilla Public License,
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can
+ obtain one at https://mozilla.org/MPL/2.0/. -}
+
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
+-- | JSON serialization.
module Language.GraphQL.JSON
( JSON(..)
, graphql
@@ -31,6 +36,7 @@ import qualified Language.GraphQL.Type.In as In
import qualified Language.GraphQL.Type.Out as Out
import qualified Language.GraphQL.Type as Type
+-- | Wraps an aeson value.
newtype JSON = JSON Aeson.Value
instance Aeson.ToJSON JSON where
@@ -111,7 +117,7 @@ instance VariableValue JSON where
foldVector _ Nothing = Nothing
foldVector variableValue (Just list) = do
coerced <- coerceVariableValue listType $ JSON variableValue
- pure $ coerced : list
+ pure $ coerced : list
coerceVariableValue _ _ = Nothing
-- | If the text parses correctly as a @GraphQL@ query the query is