summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2021-06-18 06:51:14 +0200
committerEugen Wissner <belka@caraus.de>2021-06-18 06:51:14 +0200
commit6fe9eb72e42fb4ae36435324148e8f96e871a26c (patch)
treebc0e10cb452702ea103a710575a404eda4b3dc4b /src
parent2ce2be5d917091872b45b650b60ac2a23f544916 (diff)
downloadgraphql-6fe9eb72e42fb4ae36435324148e8f96e871a26c.tar.gz
Fix merging fields with arguments
executeField shouldn't assume that a selection has only one field with a given name, but it should take the first field. The underlying cause is a wrong pattern, which (because of the laziness) is executed only if the field has arguments.
Diffstat (limited to 'src')
-rw-r--r--src/Language/GraphQL/Execute/Execution.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Language/GraphQL/Execute/Execution.hs b/src/Language/GraphQL/Execute/Execution.hs
index 742a6a9..a217d9c 100644
--- a/src/Language/GraphQL/Execute/Execution.hs
+++ b/src/Language/GraphQL/Execute/Execution.hs
@@ -97,7 +97,7 @@ executeField fieldResolver prev fields
where
executeField' fieldDefinition resolver = do
let Out.Field _ fieldType argumentDefinitions = fieldDefinition
- let (Transform.Field _ _ arguments' _ _ :| []) = fields
+ let Transform.Field _ _ arguments' _ _ = NonEmpty.head fields
case coerceArgumentValues argumentDefinitions arguments' of
Nothing -> addError null $ Error "Argument coercing failed." [] []
Just argumentValues -> do