morpheus-graphql v0.8.0 Release Notes
Release Date: 2019-12-15 // over 4 years ago-
๐ Changed
๐ deprecated:
INPUT_OBJECT
,OBJECT
,UNION
,- use
INPUT
instead ofINPUT_OBJECT
- use
deriving(GQLType)
insead ofOBJECT
orUNION
only namespaced Unions generate regular graphql Union, other attempts will be wrapped inside an object with constructor name :
e.g:
data Character =CharacterDeity DeitySomeDeity Deityderiving (GQLType)
where
Deity
is Object.
will generateunion CHaracter = Deity | SomeDeitytype SomeDeity { \_0: Deity }
โ Added
failRes
for resolver failures- โ added kind: INPUT , OUTPUT
- Automatic Type Inference (only for Object, Union and Enum)
- More general stateful resolvers which accept instances of MonadIO (Authored by Sebastian Pulido [sebashack])
๐ Utility to create web-socket applications with custom MonadIO instances (Authored by Sebastian Pulido [sebashack])
data Realm=Sky | Sea | Underworldderiving (Generic, GQLType)data Deity= Deity{fullName:: Text, realm:: Realm} deriving (Generic, GQLType)data Character=CharacterDeity Deity -- Only <tyconName><conName> should generate direct link-- RECORDS | Creature { creatureName :: Text, creatureAge :: Int }--- Types | SomeDeity Deity | CharacterInt Int | SomeMutli Int Text--- ENUMS | Zeus | Cronus deriving (Generic, GQLType)
will generate schema:
enum Realm { Sky Sea Underworld}type Deity { fullName: String!realm: Realm!}union Character = Deity | Creature | SomeDeity | CharacterInt | SomeMutli | CharacterEnumObjecttype Creature { creatureName: String!creatureAge: Int!}type SomeDeity { \_0: Deity!}type CharacterInt { \_0: Int!}type SomeMutli { \_0: Int!\_1: String!}# enumtype CharacterEnumObject { enum: CharacterEnum!}enum CharacterEnum { Zeus Cronus}
rules:
haskell union type with only empty constructors (e.g
Realm
), will generate graphqlenum
haskell record without union (e.g
Deity
), will generate graphqlobject
namespaced Unions:
CharacterDeity
whereCharacter
is TypeConstructor andDeity
referenced object (not scalar) type: will be generate regular graphql Unionunion Character = Deity | ...
for union recrods (
Creature { creatureName :: Text, creatureAge :: Int }
) will be referenced in union type, plus typeCreature
will be added in schema.e.g
union Character = ... | Creature | ... type Creature { creatureName : String! creatureAge: Int! }
all empty constructors in union will be summed in type
<tyConName>Enum
(e.gCharacterEnum
), this enum will be wrapped inCharacterEnumObject
and this type will be added to unionCharacter
. as in example abovethere is only types left with form
TypeName Type1 2Type ..
(e.gSomeDeity Deity
,CharacterInt Int
,SomeMutli Int Text
),morpheus will generate objet type from it:
type TypeName { \_0: Type1!\_1: Type2! ... }
โ Removed
- โ removed kind: INPUT_UNION
๐ Fixed
- ๐ป on filed resolver was displayed. unexhausted case exception of graphql error
- ๐ support of signed numbers (e.g
-4
) - ๐ support of round floats (e.g
1.000
) - validation checks undefined fields on inputObject
- ๐ variables are supported inside input values
- use