Rewrite selections into a Sequence. Fix #21

This commit is contained in:
2019-11-16 11:41:40 +01:00
parent 115aa02672
commit 7b92e5bcfd
5 changed files with 27 additions and 26 deletions

View File

@ -8,6 +8,7 @@ module Language.GraphQL.Execute
import Control.Monad.IO.Class (MonadIO)
import qualified Data.Aeson as Aeson
import Data.Foldable (toList)
import Data.List.NonEmpty (NonEmpty(..))
import qualified Data.List.NonEmpty as NE
import Data.Text (Text)
@ -71,6 +72,6 @@ operation :: MonadIO m
-> AST.Core.Operation
-> m Aeson.Value
operation schema (AST.Core.Query _ flds)
= runCollectErrs (Schema.resolve (NE.toList schema) (NE.toList flds))
= runCollectErrs (Schema.resolve (toList schema) flds)
operation schema (AST.Core.Mutation _ flds)
= runCollectErrs (Schema.resolve (NE.toList schema) (NE.toList flds))
= runCollectErrs (Schema.resolve (toList schema) flds)