All Versions
30
Latest Version
Avg Release Cycle
16 days
Latest Release
-

Changelog History
Page 3

  • v0.5.0 Changes

    October 31, 2019

    โž• Added

    • ๐Ÿ“œ dummy support of directives, only parsing not actual implementation

    ๐Ÿ›  Fixed

    • ๐Ÿ“œ can be parsed implements with multiple interfaces separated by &
    • 0๏ธโƒฃ can be parsed default value on inputobject
    • ๐Ÿ“œ Parser supports anonymous Operation: query , mutation , subscription for example:
      mutation {
         name
      }
    
    • Morpheus client does not breaks on Boolean type, converts every GraphQL type Boolean to haskell Bool and GQL String to Text

    ๐Ÿ”„ Changed

    • โฌ‡๏ธ Reduced GQLRootResolver signature :

    GQLRootResolver IO () () Query () () -> GQLRootResolver IO () Query () ()

    GQLRootResolver IO Channel Content Query Mutation Subscription -> GQLRootResolver IO APIEvent Query Mutation Subscription

    where APIEvent = Event Channel Content

    • GQLRootResolver automatically assigns corresponding monad to GraphQL Types.

    you can write just:

      GQLRootResolver IO APIEvent Query  Mutation Subscription
    

    instead of:

      GQLRootResolver IO APIEvent (Query (Resolver IO))  (Mutation (MutResolver IO ApiEvent) (Subscription (SubResolver IO ApiEvent))
    

    where operations are generated by importGQLDocument or have form :

      data Query m = Query {
        field1 :: Args -> m Field1,
        ....
      }
    
    • () was replaced with Undefined in GQLRootResolver for empty operations mutation, subscription rootResolver :: GQLRootResolver IO () Query Undefined Undefined
    • Root Operations Query, Mutation, Subscription are passed to root resolvers without boxing inside a monad.
    • there are only 3 kind of resolvers MutResolver, SubResolver , QueryResolver defined by GADT Resolver
  • v0.4.0 Changes

    October 08, 2019

    ๐Ÿ”„ Changed

    ๐Ÿ‘Œ support of Default Value:

    • on query: Parsing Validating and resolving

    - on Document: only Parsing

    ๐Ÿšš lens is removed from Library, client field collision can be handled with GraphQL alias:

    { user { namefriend { friendName: name } } }
    

    ๐Ÿ›  Fixed:

    Data.Morpheus.Document.toGraphQLDocument generates only user defined types. #259

    Morpheus Client Namespaces Input Type Fields, they don't collide anymore:
    example:
    schema:

    input Person { name: String!}
    

    query:

    query GetUser (parent: Person!) { .... }
    

    wil generate:

    data GetUserArgs = GetUserArgs { getUserArgsParent: Person} deriving ...data Person = Person { personName: Person} deriving ...
    

    Morpheus Client Generated Output Object And Union Types don't collide:

    type Person { name: String!parent: Person!friend: Person!}
    

    And we select

    { user { namefriend { name } parent { name } bestFriend: friend { nameparent { name } } } }
    

    client will Generate:

    • UserPerson from {user
    • UserFriendPerson: from {user{freind
    • UserParentPerson: from {user{parent
    • UserBestFriendPerson: from {user{bestFrend

    - UserBestFriendParentPerson: from {user{bestFrend{parent

    GraphQL Client Defines enums and Input Types only once per query and they don't collide

  • v0.3.1 Changes

    October 05, 2019

    ๐Ÿ”„ Changed

    • โœ‚ removed dependencies: attoparsec , utf8-string
    • โšก๏ธ updated aeson lower bound up to: 1.4.4.0
  • v0.3.0 Changes

    October 04, 2019

    โž• Added

    • ๐Ÿ‘‰ user can import GraphQL Document and generate types with it.
        importGQLDocument "API.gql"
    

    this will generate types defined in API.gql

    ๐Ÿ›  Fixed

    • String defined in GQLDcoument will be converted to Text by template haskell

    • ๐Ÿ‘ importGQLDocument and gqlDocument supports Mutation, Subscription and Resolvers with custom Monad

    for example. if we have:

      type Deity {
        name: String!
        power: Power!
      }
    

    where Power is another object defined by gql schema. template haskell will represent this type as:

         data Deity m = Deity {
           name :: () -> m Text,
           power :: () -> m (Power m)
         }
    

    where m is resolver Monad.

    • importGQLDocumentWithNamespace generates namespaced haskell records. so that you have no more problem with name collision. from this gql type:
      type Deity {
        name: (id:Int)String!
        power: Power!
      }
    

    will be generated.

      data Deity m = Deity {
        deityName :: DeityNameArgs -> m Text,
        deityPower :: () -> m (Power m)
      }
    
      data DeityNameArgs = DeityNameArgs {
        deityNameArgsId :: Int
      }
    

    ๐Ÿ”„ Changed

    • GQLType is mandatory for every GQL Type (including Query, Mutation and Subscription)
    • subscription Resolver changed

    from:

        Subscription {newDeity = \args -> Event {channels = [ChannelA], content = newDeityResolver } }
    

    to:

        Subscription {newDeity = \args -> SubResolver {subChannels = [ChannelA], subResolver = newDeityResolver } }
    
  • v0.2.2 Changes

    ๐Ÿ›  Fixed

    • ๐Ÿ“œ Parser Supports GraphQL multiline comments
    • ๐Ÿ‘ Morpheus GraphQL Client: Support GraphQL Alias
    • ๐Ÿ‘Œ Support of GraphQL Interfaces on GraphQL Document:
      # simple.gql
      interface Node {
        nodeId: ID!
      }
    
      type SimpleType implements Node {
        nodeId: ID!
        name: String!
      }
    

    morpheus compiler will read interfaces and validate implements. template haskell will generate haskell types only for types not for interfaces.

    haskell type from simple.gql:

       data SimpleType = SimpleType {
          nodeId :: ID!
          name   :: Text!
        }  deriving (Generic)
    

    at the time compiler does not validates field Arguments by interface

  • v0.2.2-alpha Changes

    August 30, 2019

    ๐Ÿ›  Fixed

    ๐Ÿ“œ Parser Supports GraphQL multiline comments

    ๐Ÿ‘ Morpheus GraphQL Client: Support GraphQL Alias

    ๐Ÿ‘Œ Support of GraphQL Interfaces on GraphQL Document:

    # simple.gqlinterface Node { nodeId: ID!}type SimpleType implements Node { nodeId: ID!name: Text!}
    

    morpheus compiler will read interfaces and validate implements.
    template haskell will generate haskell types only for types not for interfaces.

    haskell type from simple.gql:

     data SimpleType = SimpleType {nodeId :: ID!name:: Text!}deriving (Generic)
    

    at the time compiler does not validates field Arguments by interface

  • v0.2.1 Changes

    August 23, 2019

    [0.2.1] - 23.08.2019

    • ๐Ÿ— assets are added to cabal source files to fix distribution building
  • v0.2.0 Changes

    โž• Added

    • ๐Ÿ“œ Parser Supports GraphQL comments
    • โœจ Enhanced Subscription: mutation can trigger subscription with arguments
    • ๐Ÿ‘ Experimental Support of Input Unions
    • GraphQL schema generating with: Data.Morpheus.Document.toGraphQLDocument
    • Generating dummy Morpheus Api from schema.gql:
      morpheus build schema/mythology.gql src/MythologyApi.hs
    

    details

    • ๐Ÿ‘ convertToJSONName & convertToHaskellName has been extended to support all Haskell 2010 reserved identities. details

    • GraphQL Client with Template haskell QuasiQuotes (Experimental, Not fully Implemented)

      defineQuery
        [gql|
          query GetHero ($byRealm: Realm)
            {
              deity (realm:$byRealm) {
                power
                fullName
              }
            }
        |]
    

    will Generate:

    • response type GetHero, Deity with Lens Instances
    • input types: GetHeroArgs , Realm
    • instance for Fetch typeClass

    so that

        fetchHero :: Args GetHero -> m (Either String GetHero)
        fetchHero = fetch jsonRes args
            where
              args = GetHeroArgs {byRealm = Just Realm {owner = "Zeus", surface = Just 10}}
              jsonRes :: ByteString -> m ByteString
              jsonRes = <fetch query from server>
    

    resolves well typed response GetHero.

    • Ability to define GQLSchema with GraphQL syntax , so that with this schema
    
      [gqlDocument|
        type Query {
          deity (uid: Text! ) : Deity!
        }
    
        type Deity {
          name  : Text!
          power : Text
        }
      |]
    
      rootResolver :: GQLRootResolver IO () () Query () ()
      rootResolver =
        GQLRootResolver {queryResolver = return Query {deity}, mutationResolver = pure (), subscriptionResolver = pure ()}
        where
          deity DeityArgs {uid} = pure Deity {name, power}
            where
              name _ = pure "Morpheus"
              power _ = pure (Just "Shapeshifting")
    

    Template Haskell Generates types: Query , Deity, DeityArgs, that can be used by rootResolver

    generated types are not compatible with Mutation, Subscription, they can be used only in Query, but this issue will be fixed in next release

    ๐Ÿ›  Fixed:

    • ๐Ÿ“œ Parser supports enums inside input Object
    • fulfilled fragment Validation (added: unusedFragment,nameConflict)
    • correct decoding of Enums with more than 3 constructor #201

    ๐Ÿ”„ Changed

    • WebSocket subProtocol changed from graphql-subscriptions to graphql-ws

    • ๐Ÿšš type familiy KIND is moved into typeClasses GQLType, so you should replace

      type instance KIND Deity = OBJECT
    
      instance GQLType Deity where
        description  = const "Custom Description for Client Defined User Type"
    
      data Deity = Deity { fullName :: Text } deriving (Generic)
    

    with

      instance GQLType Deity where
      type KIND Deity = OBJECT
      description = const "Custom Description for Client Defined User Type"
    
      data Deity = Deity { fullName :: Text } deriving (Generic)
    
    • Duplicated variable names in Http requests are validated using Aeson's jsonNoDup function. So the following request will result in a parsing error
      {"query":"...",
      "variables":{"email":"[email protected]", "email":"[email protected]",...}}
    
  • v0.1.1 Changes

    ๐Ÿ›  Fixed:

    • () as Subscription or Mutation does not defines Operator without fields
  • v0.1.0 Changes

    thanks for contributing to: @krisajenkins, @hovind, @vmchale, @msvbg

    โž• Added

    • ๐Ÿ‘Œ support for Union Types: type instance KIND <type> = UNION
    • ๐Ÿ‘Œ support of haskell Types: Map, Set, and Pair (a,b)
    • ๐Ÿ‘ GraphQL Resolver supports custom Monad
    • โž• add Interpreter class with instances:

      • ByteString -> m ByteString and Lazy ByteString, where m is resolver monad
      • Text -> m Text and Lazy Text, where m is resolver monad
      • GQLRequest -> m GQLResponse , When you using it inside another Component that have Manual ToJSON deriving, you have to ensure that GQLResponse will be encoded with toEncoding, and not with toJSON.
    • Schema Validation:

      • Name Collision
    • ๐Ÿ‘Œ support of Parsing input values: Objects,Arrays

    • ๐Ÿ‘Œ support scalar type: ID

    • ๐Ÿ“œ scalar Types are validated by GQLScalar instance function parseValue

    • TypeFamily KIND with:

      • SCALAR
      • OBJECT,
      • ENUM
      • INPUT_OBJECT
      • UNION
    • inline Fragments

    • GraphQL Aliases

    • Subscriptions: GQLSubscription

      • a -> EffectM b operation: is resolver that contains side effect in EffectM. is used for Mutation and Subscribe communication
      • gqlEffectResolver ["CHANNEL_ID"]: packs as effect Resolver. if mutation and subscription resolver have same channel then every call of mutation will trigger subscription resolver
      • GQLState: shared state between http and websocket server
      • gqlSocketApp :converts interpreter to websocket application
      • graphql-subscriptions: Apollo GraphQL subProtocol
    • language:

      • Query supports : __type(name:"type")
      • On every Object can be selected : __typename

    ๐Ÿ”„ Changed

    • GQLRootResolver, GQLType(..) , GQLScalar(..) are moved in Data.Morpheus.Types
    • GQLRoot { query, mutation, subscription } to GQLRootResolver {queryResolver, mutationResolver, subscriptionResolver}
    • interpreter: can be used in http and websocket server
    • GQLKind renamed as GQLType
    • types can be derived just with (Generic,GQLType)
    • haskell record field type' will generate GQL Object field type
    • public API (all other modules are hidden):
      • Data.Morpheus
      • Data.Morpheus.Kind
      • Data.Morpheus.Types
      • Data.Morpheus.Execution.Subscription

    ๐Ÿ›  Fixed:

    • ๐Ÿ“œ parser can read fields with digits like: a1 , _1
    • you can use Wrapped type and Wrapped Primitive Types issue #136:
      • wrapped TypesNames will be separated with "_" : typeName(Either A B) -> "Either_A_B"
    • introspection:
      • argument supports Non-Null and List
      • every field has correct kind

    โœ‚ Removed

    • GQLArgs: you can derive arguments just with Generic without GQLArgs
    • GQLObject: replaced with instance type instance KIND <Type> = OBJECT
    • GQLEnum: replaced with instance type instance KIND <Type> = ENUM
    • GQLInput: replaced with instance type instance KIND <Type> = INPUT_OBJECT
    • Typeable : with new deriving it is not required anymore
    • Wrapper: with TypeFamilies there is no need for Wrapper
    • a ::-> b is Replaced by a -> ResM b where ResM is alias for Resolver IO a
    • GQLMutation , GQLQuery : with new deriving it is not required anymore
    • Resolver constructor replaced by functions:
      • gqlResolver : packs m Either String a to Resolver m a
      • gqlEffectResolver: resolver constructor for effectedResolver
      • liftEffectResolver: lifts normal resolver to Effect Resolver.