Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Output types and values.
This module is intended to be imported qualified, to avoid name clashes
with In
.
Synopsis
- data Field m = Field (Maybe Text) (Type m) (HashMap Name Argument)
- data InterfaceType m = InterfaceType Name (Maybe Text) [InterfaceType m] (HashMap Name (Field m))
- data ObjectType m = ObjectType Name (Maybe Text) [InterfaceType m] (HashMap Name (Resolver m))
- data Resolver m = Resolver (Field m) (ActionT m Value)
- data Type m
- = NamedScalarType ScalarType
- | NamedEnumType EnumType
- | NamedObjectType (ObjectType m)
- | NamedInterfaceType (InterfaceType m)
- | NamedUnionType (UnionType m)
- | ListType (Type m)
- | NonNullScalarType ScalarType
- | NonNullEnumType EnumType
- | NonNullObjectType (ObjectType m)
- | NonNullInterfaceType (InterfaceType m)
- | NonNullUnionType (UnionType m)
- | NonNullListType (Type m)
- data UnionType m = UnionType Name (Maybe Text) [ObjectType m]
- isNonNullType :: forall m. Type m -> Bool
- pattern EnumBaseType :: forall m. EnumType -> Type m
- pattern InterfaceBaseType :: forall m. InterfaceType m -> Type m
- pattern ListBaseType :: forall m. Type m -> Type m
- pattern ObjectBaseType :: forall m. ObjectType m -> Type m
- pattern ScalarBaseType :: forall m. ScalarType -> Type m
- pattern UnionBaseType :: forall m. UnionType m -> Type m
Documentation
Output object field definition.
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.
InterfaceType Name (Maybe Text) [InterfaceType m] (HashMap Name (Field m)) |
Instances
Eq (InterfaceType a) Source # | |
Defined in Language.GraphQL.Type.Out (==) :: InterfaceType a -> InterfaceType a -> Bool # (/=) :: InterfaceType a -> InterfaceType a -> Bool # |
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.
ObjectType Name (Maybe Text) [InterfaceType m] (HashMap Name (Resolver m)) |
Instances
Eq (ObjectType a) Source # | |
Defined in Language.GraphQL.Type.Out (==) :: ObjectType a -> ObjectType a -> Bool # (/=) :: ObjectType a -> ObjectType a -> Bool # |
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).
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.
UnionType Name (Maybe Text) [ObjectType m] |
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 InterfaceBaseType :: forall m. InterfaceType m -> Type m Source #
Matches either NamedInterfaceType
or NonNullInterfaceType
.
pattern ListBaseType :: forall m. Type m -> Type m Source #
Matches either ListType
or NonNullListType
.
pattern ObjectBaseType :: forall m. ObjectType m -> Type m Source #
Matches either NamedObjectType
or NonNullObjectType
.
pattern ScalarBaseType :: forall m. ScalarType -> Type m Source #
Matches either NamedScalarType
or NonNullScalarType
.
pattern UnionBaseType :: forall m. UnionType m -> Type m Source #
Matches either NamedUnionType
or NonNullUnionType
.