Skip to content

morpheus-graphql-0.5.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@nalchevanidze nalchevanidze released this 31 Oct 22:32
a24330d

Added

  • dummy support of directives, only parsing not actual implementation

Fixed

  • can be parsed implements with multiple interfaces separated by &

  • 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