Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Helper functions and exceptions to write resolvers.
Synopsis
- argument :: (MonadCatch m, FromGraphQL a) => Name -> ReaderT Context m a
- defaultResolver :: MonadCatch m => Name -> Resolve m
Documentation
argument :: (MonadCatch m, FromGraphQL a) => Name -> ReaderT Context m a Source #
Takes an argument name, validates that the argument exists, and optionally converts it to a user-defined type.
defaultResolver :: MonadCatch m => Name -> Resolve m Source #
Default resolver expects that the field value is returned by the parent object. If the parent is not an object or it doesn't contain the requested field name, an error is thrown.