mu-graphql-0.5.0.3: GraphQL support for Mu
Safe HaskellNone
LanguageHaskell2010

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

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.

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

Instances details
ReflectValueConst ('VCNull :: ValueConst nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

KnownNat n => ReflectValueConst ('VCInt n :: ValueConst Nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

Methods

reflectValueConst :: proxy ('VCInt n) -> ConstValue Source #

KnownSymbol e => ReflectValueConst ('VCEnum e :: ValueConst nat Symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

Methods

reflectValueConst :: proxy ('VCEnum e) -> ConstValue Source #

ReflectValueConst ('VCBoolean 'False :: ValueConst nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

ReflectValueConst ('VCBoolean 'True :: ValueConst nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

KnownSymbol s => ReflectValueConst ('VCString s :: ValueConst nat Symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

Methods

reflectValueConst :: proxy ('VCString s) -> ConstValue Source #

ReflectValueConstList xs => ReflectValueConst ('VCList xs :: ValueConst nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

Methods

reflectValueConst :: proxy ('VCList xs) -> ConstValue Source #

ReflectValueConstObject xs => ReflectValueConst ('VCObject xs :: ValueConst nat symbol) Source # 
Instance details

Defined in Mu.GraphQL.Annotations

Methods

reflectValueConst :: proxy ('VCObject xs) -> ConstValue Source #

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.