Release 1.0.0.0
This commit is contained in:
parent
c93c64a7f4
commit
1d7f016b9c
5 changed files with 114 additions and 10 deletions
src/Language/GraphQL
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue