Skip to content

Commit b1cfe40

Browse files
list of plans
1 parent e99dc0f commit b1cfe40

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

server/src-lib/Hasura/GraphQL/Execute.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Hasura.GraphQL.Execute
22
( GQExecPlan(..)
3+
, GQFieldExecPlan(..)
34

45
, ExecPlanPartial
56
, getExecPlanPartial
@@ -60,12 +61,13 @@ import qualified Hasura.Logging as L
6061
--
6162
-- The 'a' is parameterised so this AST can represent
6263
-- intermediate passes
63-
data GQExecPlan a
64+
data GQFieldExecPlan a
6465
= GExPHasura !a
65-
| GExPRemote !RemoteSchemaInfo !VQ.RootSelSet
66-
| GExPMixed (Seq.Seq (Either (RemoteSchemaInfo, VQ.RootSelSet) a))
66+
| GExPRemote !RemoteSchemaInfo !VQ.Field
6767
deriving (Functor, Foldable, Traversable)
6868

69+
type GQExecPlan a = [GQFieldExecPlan a]
70+
6971
-- | Execution context
7072
data ExecutionCtx
7173
= ExecutionCtx
@@ -80,7 +82,7 @@ data ExecutionCtx
8082
}
8183

8284
-- This is for when the graphql query is validated
83-
type ExecPlanPartial = GQExecPlan (GCtx, VQ.RootSelSet)
85+
type ExecPlanPartial = [GQFieldExecPlan (GCtx, VQ.Field)]
8486

8587
getExecPlanPartial
8688
:: (MonadError QErr m)

server/src-lib/Hasura/GraphQL/Transport/HTTP.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,13 @@ runGQ
2626
-> m (HttpResponse EncJSON)
2727
runGQ reqId userInfo reqHdrs req = do
2828
E.ExecutionCtx _ sqlGenCtx pgExecCtx planCache sc scVer _ enableAL <- ask
29-
execPlan <- E.getResolvedExecPlan pgExecCtx planCache
29+
fieldPlans <- E.getResolvedExecPlan pgExecCtx planCache
3030
userInfo sqlGenCtx enableAL sc scVer req
31-
case execPlan of
31+
forM fieldPlans (\execPlan -> case execPlan of
3232
E.GExPHasura resolvedOp ->
3333
flip HttpResponse Nothing <$> runHasuraGQ reqId req userInfo resolvedOp
3434
E.GExPRemote rsi rootSelSet ->
35-
E.execRemoteGQ reqId userInfo reqHdrs req rsi undefined
36-
E.GExPMixed fieldPlans -> undefined
35+
E.execRemoteGQ reqId userInfo reqHdrs req rsi undefined)
3736

3837
runHasuraGQ
3938
:: ( MonadIO m

0 commit comments

Comments
 (0)