diff options
| author | Eugen Wissner <belka@caraus.de> | 2021-06-17 08:15:27 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2021-06-17 08:15:27 +0200 |
| commit | 2ce2be5d917091872b45b650b60ac2a23f544916 (patch) | |
| tree | 0b4b3dbceb74cb810522dff5fee923fcc92d8a78 /src/Language/GraphQL/Execute | |
| parent | c311cb0070de2979111014e8e22a5f6fefee3ea3 (diff) | |
| download | graphql-2ce2be5d917091872b45b650b60ac2a23f544916.tar.gz | |
Provide location information for interface errors
Diffstat (limited to 'src/Language/GraphQL/Execute')
| -rw-r--r-- | src/Language/GraphQL/Execute/Execution.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Language/GraphQL/Execute/Execution.hs b/src/Language/GraphQL/Execute/Execution.hs index b671c13..742a6a9 100644 --- a/src/Language/GraphQL/Execute/Execution.hs +++ b/src/Language/GraphQL/Execute/Execution.hs @@ -132,12 +132,13 @@ completeValue (Out.ObjectBaseType objectType) fields result = completeValue (Out.InterfaceBaseType interfaceType) fields result | Type.Object objectMap <- result = do let abstractType = Internal.AbstractInterfaceType interfaceType + let Transform.Field _ _ _ _ location = NonEmpty.head fields concreteType <- resolveAbstractType abstractType objectMap case concreteType of Just objectType -> executeSelectionSet result objectType $ mergeSelectionSets fields Nothing -> addError null - $ Error "Interface value completion failed." [] [] + $ Error "Interface value completion failed." [location] [] completeValue (Out.UnionBaseType unionType) fields result | Type.Object objectMap <- result = do let abstractType = Internal.AbstractUnionType unionType @@ -148,7 +149,8 @@ completeValue (Out.UnionBaseType unionType) fields result $ mergeSelectionSets fields Nothing -> addError null $ Error "Union value completion failed." [location] [] -completeValue _ _ _ = addError null $ Error "Value completion failed." [] [] +completeValue _ (Transform.Field _ _ _ _ location :| _) _ = + addError null $ Error "Value completion failed." [location] [] mergeSelectionSets :: MonadCatch m => NonEmpty (Transform.Field m) |
