| Safe Haskell | None | 
|---|---|
| Language | Haskell2010 | 
Mu.GraphQL.Annotations
Description
GraphQL schemas may contain some information which cannot be directly represented in a Mu schema or service definition. The types in this module can be used with the annotation mechanism in Mu to provide this additional information.
Synopsis
- data ValueConst nat symbol
- = VCInt nat
 - | VCString symbol
 - | VCBoolean Bool
 - | VCNull
 - | VCEnum symbol
 - | VCList [ValueConst nat symbol]
 - | VCObject [(symbol, ValueConst nat symbol)]
 
 - newtype DefaultValue = DefaultValue (ValueConst Nat Symbol)
 - class ReflectValueConst (v :: ValueConst nat symbol) where
- reflectValueConst :: proxy v -> ConstValue
 
 - fromGQLValueConst :: forall f. Alternative f => ConstValue -> f (ValueConst Integer String)
 
Documentation
data ValueConst nat symbol Source #
Type-level GraphQL constant values. Due to limitations in type-level literal values floating point constants cannot be represented.
Constructors
| VCInt nat | Integer.  | 
| VCString symbol | String.  | 
| VCBoolean Bool | Boolean.  | 
| VCNull | Null.  | 
| VCEnum symbol | Enumeration value.  | 
| VCList [ValueConst nat symbol] | List of constant values.  | 
| VCObject [(symbol, ValueConst nat symbol)] | Object represented by (key, value) tuples.  | 
newtype DefaultValue Source #
Specifies the default value of an argument. To be used as an annotation.
Constructors
| DefaultValue (ValueConst Nat Symbol) | 
class ReflectValueConst (v :: ValueConst nat symbol) where Source #
Obtain the GraphQL constant corresponding
   to a type-level constant. Inhabited by any
   ValueConst, but still required to please
   the type checker.
Methods
reflectValueConst :: proxy v -> ConstValue Source #
Obtain the GraphQL constant corresponding to a type-level constant.
Instances
fromGQLValueConst :: forall f. Alternative f => ConstValue -> f (ValueConst Integer String) Source #
Turn a ValueConst coming from parsing
   in the annotation data type. Mostly used
   internally to generate Mu schemas from GraphQL schemas.