Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- parseVariableNames :: EndpointMetadata GQLQueryWithText -> [Text]
- alignVars :: [VariableDefinition] -> [(Text, Either Text Value)] -> HashMap Name (These VariableDefinition (Either Text Value))
- resolveVar :: Name -> These VariableDefinition (Either Text Value) -> Either Text (Maybe Value)
- mkPassthroughRequest :: EndpointMetadata GQLQueryWithText -> VariableValues -> GQLReq GQLQueryText
- data RestRequest method = RestRequest {}
- runCustomEndpoint :: forall m. (MonadIO m, MonadError QErr m, MonadTrace m, MonadBaseControl IO m, MonadGQLExecutionCheck m, MonadQueryLog m, MonadExecuteQuery m, MonadMetadataStorage (MetadataStorageT m), HttpLog m, MonadQueryTags m, HasResourceLimits m) => Environment -> ExecutionCtx -> RequestId -> UserInfo -> [Header] -> IpAddress -> RestRequest EndpointMethod -> EndpointTrie GQLQueryWithText -> m (HttpLogMetadata m, HttpResponse EncJSON)
Documentation
parseVariableNames :: EndpointMetadata GQLQueryWithText -> [Text] Source #
alignVars :: [VariableDefinition] -> [(Text, Either Text Value)] -> HashMap Name (These VariableDefinition (Either Text Value)) Source #
resolveVar :: Name -> These VariableDefinition (Either Text Value) -> Either Text (Maybe Value) Source #
resolveVar
is responsible for decoding variables sent via REST request.
These can either be via body (represented by Right) or via query-param or URL param (represented by Left).
A variable can be expected, unexpected, or missing (represented by These, This, and That).
mkPassthroughRequest :: EndpointMetadata GQLQueryWithText -> VariableValues -> GQLReq GQLQueryText Source #
data RestRequest method Source #
Instances
runCustomEndpoint :: forall m. (MonadIO m, MonadError QErr m, MonadTrace m, MonadBaseControl IO m, MonadGQLExecutionCheck m, MonadQueryLog m, MonadExecuteQuery m, MonadMetadataStorage (MetadataStorageT m), HttpLog m, MonadQueryTags m, HasResourceLimits m) => Environment -> ExecutionCtx -> RequestId -> UserInfo -> [Header] -> IpAddress -> RestRequest EndpointMethod -> EndpointTrie GQLQueryWithText -> m (HttpLogMetadata m, HttpResponse EncJSON) Source #
Implements all the custom endpoints by looking up the path/methods in the endpoint trie and delegating to the graphql handler.