diff options
| author | Eugen Wissner <belka@caraus.de> | 2021-05-12 06:51:59 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2021-05-12 06:51:59 +0200 |
| commit | 1b7cd85216e58650552e690be81fb46bea2d88ab (patch) | |
| tree | 0b25b71adbcb0436ee66e1834cfc572a16c3de0e /src/Language/GraphQL/Execute/Transform.hs | |
| parent | f671645043b8d9e148ed96c3a26aa268ef0ff7b5 (diff) | |
| download | graphql-1b7cd85216e58650552e690be81fb46bea2d88ab.tar.gz | |
Add location information to the intermediate tree
Diffstat (limited to 'src/Language/GraphQL/Execute/Transform.hs')
| -rw-r--r-- | src/Language/GraphQL/Execute/Transform.hs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Language/GraphQL/Execute/Transform.hs b/src/Language/GraphQL/Execute/Transform.hs index 62e5b54..5e2054b 100644 --- a/src/Language/GraphQL/Execute/Transform.hs +++ b/src/Language/GraphQL/Execute/Transform.hs @@ -1,3 +1,7 @@ +{- 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 ExplicitForAll #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} @@ -77,7 +81,11 @@ data Operation m -- | Single GraphQL field. data Field m = Field - (Maybe Full.Name) Full.Name (HashMap Full.Name Input) (Seq (Selection m)) + (Maybe Full.Name) + Full.Name + (HashMap Full.Name Input) + (Seq (Selection m)) + Full.Location -- | Contains the operation to be executed along with its root type. data Document m = Document @@ -263,11 +271,11 @@ selection (Full.InlineFragmentSelection fragmentSelection) = inlineFragment fragmentSelection field :: Full.Field -> State (Replacement m) (Maybe (Field m)) -field (Full.Field alias name arguments' directives' selections _) = do +field (Full.Field alias name arguments' directives' selections location) = do fieldArguments <- foldM go HashMap.empty arguments' fieldSelections <- appendSelection selections fieldDirectives <- Definition.selection <$> directives directives' - let field' = Field alias name fieldArguments fieldSelections + let field' = Field alias name fieldArguments fieldSelections location pure $ field' <$ fieldDirectives where go arguments (Full.Argument name' (Full.Node value' _) _) = |
