Conversation
bbd5402 to
b1cfe40
Compare
| => G.OperationType | ||
| -> Seq.Seq VQ.Field | ||
| -> m GQLReqParsed | ||
| fieldsToRequest = undefined |
There was a problem hiding this comment.
Fill from RemoteJoins. Make sure variables are "unresolved". Discuss.
| -- pure $ mergeResponses fieldResps | ||
| pure $ head (toList fieldResps) | ||
| where | ||
| mergeResponses = undefined |
There was a problem hiding this comment.
fill from RemoteJoins
| EP.RPQuery queryPlan -> do | ||
| (tx, genSql) <- EQ.queryOpFromPlan usrVars queryVars queryPlan | ||
| let queryOp = ExOpQuery tx (Just genSql) | ||
| pure $ pure $ GQFieldResolvedHasura queryOp |
There was a problem hiding this comment.
think about caching here
| GQFieldPartialHasura (gCtx, field) -> do | ||
| (queryTx, plan, genSql) <- | ||
| getQueryOp gCtx sqlGenCtx userInfo (Seq.singleton field) | ||
| traverse_ (addPlanToCache . EP.RPQuery) plan |
There was a problem hiding this comment.
think about caching here
| forM fieldPlans $ \case | ||
| GQFieldPartialHasura (gCtx, field) -> do | ||
| (lqOp, plan) <- getSubsOp pgExecCtx gCtx sqlGenCtx userInfo field | ||
| traverse_ (addPlanToCache . EP.RPSubs) plan |
There was a problem hiding this comment.
think about caching here
| } | ||
|
|
||
| liftIO $ logGraphqlQuery logger $ QueryLog q Nothing reqId | ||
| -- liftIO $ logGraphqlQuery logger $ QueryLog q Nothing reqId |
There was a problem hiding this comment.
move logging out of here to the call-site of execRemoteGQ?
| E.ExecutionCtx _ sqlGenCtx pgExecCtx planCache sc scVer _ enableAL <- ask | ||
| execPlan <- E.getResolvedExecPlan pgExecCtx planCache | ||
| fieldPlans <- E.getResolvedExecPlan pgExecCtx planCache | ||
| userInfo sqlGenCtx enableAL sc scVer req |
There was a problem hiding this comment.
log everything here?
There was a problem hiding this comment.
but what about logging in runHasuraGQ : https://github.com/tirumaraiselvan/graphql-engine/pull/71/files#diff-ee138319d8341444234c6af198a5ea0bR57?
Maybe log the request here and its "sql map" inside runHasuraGQ?
There was a problem hiding this comment.
Or we can log at the "begin" and log at the "end"
| (mapM generateFieldPlan selSet) | ||
| VQ.RSubscription field -> | ||
| (GQExecPlanPartial G.OperationTypeMutation) <$> | ||
| (mapM generateFieldPlan (Seq.singleton field)) |
There was a problem hiding this comment.
Don't like this sequencing of a singleton but dunno what to do without complicating types.
| enableAL sc scVer reqUnparsed = do | ||
| planM <- liftIO $ EP.getPlan scVer (userRole userInfo) | ||
| opNameM queryStr planCache | ||
| -> m (Seq.Seq GQFieldResolvedPlan) |
There was a problem hiding this comment.
In RJ, this will change to GQFieldResolvedPlan -> QExecPlan (https://github.com/hasura/graphql-engine/blob/821c1c3525e36f462bedee96908646e43225c442/server/src-lib/Hasura/GraphQL/Execute.hs#L180)
where QExecPlan is type QExecPlan = ([QExecPlanUnresolved], GQFieldResolvedPlan) (https://github.com/hasura/graphql-engine/blob/821c1c3525e36f462bedee96908646e43225c442/server/src-lib/Hasura/GraphQL/Execute.hs#L95)
Might be a good idea to rename QExecPlan -> GQFieldPlan and QExecPlanUnresolved -> GQRemoteRelUnresolvedPlan
| case opType of | ||
| G.OperationTypeQuery -> | ||
| forM fieldPlans $ \case | ||
| GQFieldPartialHasura (gCtx, field) -> do |
There was a problem hiding this comment.
Introduce remoteRel plans from RJ here: https://github.com/hasura/graphql-engine/blob/821c1c3525e36f462bedee96908646e43225c442/server/src-lib/Hasura/GraphQL/Execute.hs#L214
e9fffe1 to
3f3d327
Compare
| GV.RQuery selSet -> | ||
| runInTx $ encJFromJValue <$> traverse (explainField userInfo gCtx sqlGenCtx) (toList selSet) | ||
| GV.RMutation _ -> | ||
| E.GQExecPlanPartial opType fieldPlans <- |
There was a problem hiding this comment.
I don't think Explain is that ugly anymore because of the new GQExecPlanPartial structure!
| GQFieldPartialHasura (gCtx, field) -> do | ||
| (queryTx, plan, genSql) <- | ||
| getQueryOp gCtx sqlGenCtx userInfo (Seq.singleton field) | ||
| -- traverse_ (addPlanToCache . EP.RPQuery) plan |
| forM fieldPlans $ \case | ||
| GQFieldPartialHasura (gCtx, field) -> do | ||
| (lqOp, plan) <- getSubsOp pgExecCtx gCtx sqlGenCtx userInfo field | ||
| -- traverse_ (addPlanToCache . EP.RPSubs) plan |
There was a problem hiding this comment.
how to cache? Might not be a problem here because subscriptions are always single field.
* ci: add hlint escape hatch Co-authored-by: Antoine Leblanc <antoine@hasura.io> GITHUB_PR_NUMBER: 6164 GITHUB_PR_URL: hasura#6164 * Applied changes to new workflow files. * Add missing label trigger for lint worklow Co-authored-by: Antoine Leblanc <antoine@hasura.io> GitOrigin-RevId: 3e22c30
mock exec plan 2