morpheus-graphql v0.7.0 Release Notes

Release Date: 2019-11-23 // over 4 years ago
  • โœ‚ Removed

    • toMorpheusHaskellAPi from Data.Morpheus.Document functionality will be migrated in morpheus-graphql-cli

    ๐Ÿ”„ Changed

    • liftM to MonadTrans instance method lift

    • liftEitherM to liftEither

    • Resolver operation m event value -> Resolver operation event m value , monad trans needs that last 2 type arguments are monad and value that why it was necessary

    • ๐Ÿ”ฆ exposed Data.Morpheus.Types.Internal.AST

    • Mutation Resolver was changed from

    resolver :: () -> ResolveM EVENT IO Address
    resolver = MutResolver  {
      mutEvents = [someEventForSubscription],
      mutResolver = lift setDBAddress
    }
    
    -- Mutation Wit Event Triggering : sends events to subscription
    resolver :: () -> ResolveM EVENT IO Address
    resolver = MutResolver \$ do
      value <- lift setDBAddress
      pure ([someEventForSubscription], value)
    -- or
    -- Mutation Without Event Triggering
    resolver :: () -> ResolveM EVENT IO Address
    resolver _args = lift setDBAddress
    

    โž• Added

    • โž• added parseDSL to Data.Morpheus.Document

    • ๐Ÿ‘ GraphQL SDL support fully supports descriptions: onTypes, fields , args ... with (enums, inputObjects , union, object) for example :

      """
      Description for Type Address
      """
      type Address {
        """
        Description for Field city
        """
        city: String!
        street(
          """
          Description argument id
          """
          id: ID!
        ): Int!
      }
    

    ###### GraphQL SDL

      type User {
        name: String! @deprecated(reason: "some reason")
      }
    

    will displayed in introspection

    ###### introspection.json

      {
        "data": {
          "__type": {
            "fields": [
              {
                "name": "city",
                "isDeprecated": true,
                "deprecationReason": "test deprecation field with reason"
              }
            ]
          }
        }
      }
    
    • ๐Ÿ—„ basic support of directive @deprecated on enumValue and object field, only on introspection

    • ๐Ÿ—„ GraphQL Client deprecation warnings

    on type

      type Human {
        humanName: String!
        lifetime: Lifetime! @deprecated(reason: "some reason")
        profession: Profession
      }
    

    compiler output:

      warning:
        Morpheus Client Warning:
        {
          "message":"the field \"Human.lifetime\" is deprecated. some reason",
          "locations":[{"line":24,"column":15}]
        }
    
    • ๐Ÿ†• new helper resolver types aliases:

      • ResolveQ : for Query
      • ResolveM : for Mutation
      • ResolveS : for Subscription

    ResolveM EVENT IO Address is same as MutRes EVENT IO (Address (MutRes EVENT IO))

    is helpfull wenn you want to resolve GraphQL object

    ๐Ÿ›  Fixed

    • โž• added missing Monad instance for Mutation resolver
    • defineByIntrospectionFile does not breaks if schema contains interfaces
    • ๐Ÿ‘ Morpheus Client supports Subscription and Mutationoperations