| Maintainer | Brandon Chinn <brandon@leapyear.io> |
|---|---|
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Data.GraphQL.Monad
Description
Defines the GraphQLQueryT monad transformer, which implements
MonadGraphQLQuery to allow querying GraphQL APIs.
Synopsis
- module Data.GraphQL.Monad.Class
- data GraphQLQueryT m a
- runGraphQLQueryT :: MonadIO m => GraphQLSettings -> GraphQLQueryT m a -> m a
- data GraphQLSettings = GraphQLSettings {
- managerSettings :: ManagerSettings
- url :: String
- modifyReq :: Request -> Request
- defaultGraphQLSettings :: GraphQLSettings
Documentation
module Data.GraphQL.Monad.Class
data GraphQLQueryT m a Source #
The monad transformer type that should be used to run GraphQL queries.
newtype MyMonad a = MyMonad { unMyMonad :: GraphQLQueryT IO a }
runMyMonad :: MyMonad a -> IO a
runMyMonad = runGraphQLQueryT graphQLSettings . unMyMonad
where
graphQLSettings = defaultGraphQLSettings
{ url = "https://api.github.com/graphql"
, modifyReq = \req -> req
{ requestHeaders =
(hAuthorization, "bearer my_github_token") : requestHeaders req
}
}
Instances
runGraphQLQueryT :: MonadIO m => GraphQLSettings -> GraphQLQueryT m a -> m a Source #
Run a GraphQLQueryT stack.
data GraphQLSettings Source #
The settings for running GraphQLQueryT.
Constructors
| GraphQLSettings | |
Fields
| |
defaultGraphQLSettings :: GraphQLSettings Source #
Default query settings.