graphql-1.0.2.0: Haskell GraphQL implementation
Safe HaskellNone
LanguageHaskell2010

Language.GraphQL.Type.Out

Description

Output types and values, monad transformer stack used by the GraphQL resolvers.

This module is intended to be imported qualified, to avoid name clashes with In.

Synopsis

Documentation

data Context Source #

Resolution context holds resolver arguments and the root value.

Constructors

Context 

data Field m Source #

Output object field definition.

Constructors

Field 

Fields

data InterfaceType m Source #

Interface Type Definition.

When a field can return one of a heterogeneous set of types, a Interface type is used to describe what types are possible, and what fields are in common across all types.

Instances

Instances details
Eq (InterfaceType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

Show (InterfaceType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

data ObjectType m Source #

Object type definition.

Almost all of the GraphQL types you define will be object types. Object types have a name, but most importantly describe their fields.

Instances

Instances details
Eq (ObjectType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

Methods

(==) :: ObjectType a -> ObjectType a -> Bool #

(/=) :: ObjectType a -> ObjectType a -> Bool #

Show (ObjectType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

type Resolve m = ReaderT Context m Value Source #

Monad transformer stack used by the resolvers for determining the resolved value of a field.

type Subscribe m = ReaderT Context m (SourceEventStream m) Source #

Monad transformer stack used by the resolvers for determining the resolved event stream of a subscription field.

data Resolver m Source #

Resolver associates some function(s) with each Field. ValueResolver resolves a Field into a Value. EventStreamResolver resolves additionally a Field into a SourceEventStream if it is the field of a root subscription type.

The resolvers aren't part of the Field itself because not all fields have resolvers (interface fields don't have an implementation).

type SourceEventStream m = ConduitT () Value m () Source #

A source stream represents the sequence of events, each of which will trigger a GraphQL execution corresponding to that event.

data Type m Source #

These types may be used as output types as the result of fields.

GraphQL distinguishes between "wrapping" and "named" types. Each wrapping type can wrap other wrapping or named types. Wrapping types are lists and Non-Null types (named types are nullable by default).

Instances

Instances details
Eq (Type m) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

Methods

(==) :: Type m -> Type m -> Bool #

(/=) :: Type m -> Type m -> Bool #

Show (Type a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

Methods

showsPrec :: Int -> Type a -> ShowS #

show :: Type a -> String #

showList :: [Type a] -> ShowS #

data UnionType m Source #

Union Type Definition.

When a field can return one of a heterogeneous set of types, a Union type is used to describe what types are possible.

Constructors

UnionType Name (Maybe Text) [ObjectType m] 

Instances

Instances details
Eq (UnionType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

Methods

(==) :: UnionType a -> UnionType a -> Bool #

(/=) :: UnionType a -> UnionType a -> Bool #

Show (UnionType a) Source # 
Instance details

Defined in Language.GraphQL.Type.Out

argument :: Monad m => Name -> Resolve m Source #

Retrieves an argument by its name. If the argument with this name couldn't be found, returns Null (i.e. the argument is assumed to be optional then).

isNonNullType :: forall m. Type m -> Bool Source #

Checks whether the given output type is a non-null type.

pattern EnumBaseType :: forall m. EnumType -> Type m Source #

Matches either NamedEnumType or NonNullEnumType.

pattern ListBaseType :: forall m. Type m -> Type m Source #

Matches either ListType or NonNullListType.

pattern ObjectBaseType :: forall m. ObjectType m -> Type m Source #

pattern ScalarBaseType :: forall m. ScalarType -> Type m Source #

pattern UnionBaseType :: forall m. UnionType m -> Type m Source #

Matches either NamedUnionType or NonNullUnionType.