Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- processRemoteJoins :: forall m. (MonadError QErr m, MonadIO m, MonadBaseControl IO m, MonadQueryTags m, MonadQueryLog m, MonadExecutionLog m, MonadTrace m, ProvidesNetwork m) => RequestId -> Logger Hasura -> Maybe (CredentialCache AgentLicenseKey) -> Environment -> [Header] -> UserInfo -> EncJSON -> Maybe RemoteJoins -> GQLReqUnparsed -> m EncJSON
- foldJoinTreeWith :: (MonadError QErr m, MonadQueryTags m, Traversable f, MonadTrace m, MonadIO m) => (AnyBackend SourceJoinCall -> m ByteString) -> (ValidatedRemoteSchemaDef -> GQLReqOutgoing -> m ByteString) -> UserInfo -> f Value -> RemoteJoins -> [Header] -> Maybe Name -> m (f Value)
Documentation
processRemoteJoins :: forall m. (MonadError QErr m, MonadIO m, MonadBaseControl IO m, MonadQueryTags m, MonadQueryLog m, MonadExecutionLog m, MonadTrace m, ProvidesNetwork m) => RequestId -> Logger Hasura -> Maybe (CredentialCache AgentLicenseKey) -> Environment -> [Header] -> UserInfo -> EncJSON -> Maybe RemoteJoins -> GQLReqUnparsed -> m EncJSON Source #
Process all remote joins, recursively.
Given the result of the first step of an execution and its associated remote joins, process all joins recursively to build the resulting JSON object.
This function is a thin wrapper around processRemoteJoinsWith
, and starts
the join tree traversal process by re-parsing the EncJSON
value into an
introspectable JSON Value
, and "injects" the required functions to process
each join over the network.
:: (MonadError QErr m, MonadQueryTags m, Traversable f, MonadTrace m, MonadIO m) | |
=> (AnyBackend SourceJoinCall -> m ByteString) | How to process a call to a source. |
-> (ValidatedRemoteSchemaDef -> GQLReqOutgoing -> m ByteString) | How to process a call to a remote schema. |
-> UserInfo | User information. |
-> f Value | Initial accumulator; the LHS of this join tree. |
-> RemoteJoins | |
-> [Header] | |
-> Maybe Name | |
-> m (f Value) |
Fold the join tree.
This function takes as an argument the functions that will be used to do the
actual network calls; this allows this function not to require MonadIO
,
allowing it to be used in tests.