diff options
| author | Eugen Wissner <belka@caraus.de> | 2021-06-18 06:51:14 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2021-06-18 06:51:14 +0200 |
| commit | 6fe9eb72e42fb4ae36435324148e8f96e871a26c (patch) | |
| tree | bc0e10cb452702ea103a710575a404eda4b3dc4b /src | |
| parent | 2ce2be5d917091872b45b650b60ac2a23f544916 (diff) | |
| download | graphql-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.hs | 2 |
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 |
