graphql-spice-1.0.2.0: GraphQL with batteries
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.GraphQL.Resolver

Description

Helper functions and exceptions to write resolvers.

Synopsis

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.