summaryrefslogtreecommitdiff
path: root/src/Language/GraphQL
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2022-03-29 20:20:19 +0200
committerEugen Wissner <belka@caraus.de>2022-03-29 20:39:26 +0200
commit1d7f016b9c19dc4ce5b058b2a6d248eaa61ac0e6 (patch)
treee87b368ed7224cb7fdcc045e9ba48daef05107c4 /src/Language/GraphQL
parentc93c64a7f4828a202770b1cfadc79f28aba1da99 (diff)
downloadgraphql-spice-1d7f016b9c19dc4ce5b058b2a6d248eaa61ac0e6.tar.gz
Release 1.0.0.0v1.0.0.0
Diffstat (limited to 'src/Language/GraphQL')
-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