Skip to content

Commit

Permalink
Release 0.17.0 (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalchevanidze committed Feb 25, 2021
1 parent c4afa1d commit f76f54e
Show file tree
Hide file tree
Showing 25 changed files with 101 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
run: |
stack upload morpheus-graphql-core
stack upload morpheus-graphql-client
stack upload morpheus-graphql-subscriptions
stack upload morpheus-graphql-app
stack upload morpheus-graphql-subscriptions
stack upload .
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
Expand Down
54 changes: 18 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _stack.yml_
resolver: lts-16.2

extra-deps:
- morpheus-graphql-0.16.0
- morpheus-graphql-0.17.0
```

As Morpheus is quite new, make sure stack can find morpheus-graphql by running `stack upgrade` and `stack update`
Expand Down Expand Up @@ -232,59 +232,39 @@ To use union type, all you have to do is derive the `GQLType` class. Using Graph

```haskell
data Character
= CharacterDeity Deity -- Only <tyConName><conName> should generate direct link
-- RECORDS
= CharacterDeity Deity -- will be unwrapped, since Character + Deity = CharacterDeity
| SomeDeity Deity -- will be wrapped since Character + Deity != SomeDeity
| Creature { creatureName :: Text, creatureAge :: Int }
--- Types
| SomeDeity Deity
| CharacterInt Int
| SomeMulti Int Text
--- ENUMS
| Demigod Text Text
| Zeus
| Cronus
deriving (Generic, GQLType)
```

where `Deity` is an object.

As you see there are different kinds of unions. `morpheus` handles them all.
As we see, there are different kinds of unions. `Morpheus` handles them all.

This type will be represented as

```gql
union Character =
Deity # unwrapped union: because "Character" <> "Deity" == "CharacterDeity"
| Creature
| SomeDeity # wrapped union: because "Character" <> "Deity" /= SomeDeity
| CharacterInt
| SomeMulti
| CharacterEnumObject # no-argument constructors all wrapped into an enum
type Creature {
creatureName: String!
creatureAge: Int!
}
union Character = Deity | SomeDeity | Creature | SomeMulti | Zeus

type SomeDeity {
_0: Deity!
}

type CharacterInt {
_0: Int!
type Creature {
creatureName: String!
creatureAge: Int!
}

type SomeMulti {
type Demigod {
_0: Int!
_1: String!
}

# enum
type CharacterEnumObject {
enum: CharacterEnum!
}

enum CharacterEnum {
Zeus
Cronus
type Zeus {
_: Unit!
}
```

Expand Down Expand Up @@ -348,10 +328,12 @@ To use custom scalar types, you need to provide implementations for `parseValue`
```haskell
data Odd = Odd Int deriving (Generic)

instance GQLScalar Odd where
parseValue (Int x) = pure $ Odd (... )
parseValue (String x) = pure $ Odd (... )
serialize (Odd value) = Int value
instance DecodeScalar Euro where
decodeScalar (Int x) = pure $ Odd (... )
decodeScalar _ = Left "invalid Value!"

instance EncodeScalar Euro where
encodeScalar (Odd value) = Int value

instance GQLType Odd where
type KIND Odd = SCALAR
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.17.0 - Unreleased
## 0.17.0 - 25.02.2021

## new features

Expand Down
54 changes: 18 additions & 36 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ _stack.yml_
resolver: lts-16.2

extra-deps:
- morpheus-graphql-0.16.0
- morpheus-graphql-0.17.0
```

As Morpheus is quite new, make sure stack can find morpheus-graphql by running `stack upgrade` and `stack update`
Expand Down Expand Up @@ -238,59 +238,39 @@ To use union type, all you have to do is derive the `GQLType` class. Using Graph

```haskell
data Character
= CharacterDeity Deity -- Only <tyConName><conName> should generate direct link
-- RECORDS
= CharacterDeity Deity -- will be unwrapped, since Character + Deity = CharacterDeity
| SomeDeity Deity -- will be wrapped since Character + Deity != SomeDeity
| Creature { creatureName :: Text, creatureAge :: Int }
--- Types
| SomeDeity Deity
| CharacterInt Int
| SomeMulti Int Text
--- ENUMS
| Demigod Text Text
| Zeus
| Cronus
deriving (Generic, GQLType)
```

where `Deity` is an object.

As you see there are different kinds of unions. `morpheus` handles them all.
As we see, there are different kinds of unions. `Morpheus` handles them all.

This type will be represented as

```gql
union Character =
Deity # unwrapped union: because "Character" <> "Deity" == "CharacterDeity"
| Creature
| SomeDeity # wrapped union: because "Character" <> "Deity" /= SomeDeity
| CharacterInt
| SomeMulti
| CharacterEnumObject # no-argument constructors all wrapped into an enum
type Creature {
creatureName: String!
creatureAge: Int!
}
union Character = Deity | SomeDeity | Creature | SomeMulti | Zeus

type SomeDeity {
_0: Deity!
}

type CharacterInt {
_0: Int!
type Creature {
creatureName: String!
creatureAge: Int!
}

type SomeMulti {
type Demigod {
_0: Int!
_1: String!
}

# enum
type CharacterEnumObject {
enum: CharacterEnum!
}

enum CharacterEnum {
Zeus
Cronus
type Zeus {
_: Unit!
}
```

Expand Down Expand Up @@ -354,10 +334,12 @@ To use custom scalar types, you need to provide implementations for `parseValue`
```haskell
data Odd = Odd Int deriving (Generic)

instance GQLScalar Odd where
parseValue (Int x) = pure $ Odd (... )
parseValue (String x) = pure $ Odd (... )
serialize (Odd value) = Int value
instance DecodeScalar Euro where
decodeScalar (Int x) = pure $ Odd (... )
decodeScalar _ = Left "invalid Value!"

instance EncodeScalar Euro where
encodeScalar (Odd value) = Int value

instance GQLType Odd where
type KIND Odd = SCALAR
Expand Down
4 changes: 2 additions & 2 deletions examples-subscription-extpubsub/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ dependencies:
- hasql
- hasql-notifications
# graphql :
- morpheus-graphql >= 0.16.0
- morpheus-graphql-core >= 0.16.0
- morpheus-graphql >= 0.17.0
- morpheus-graphql-core >= 0.17.0
- text

library:
Expand Down
2 changes: 1 addition & 1 deletion morpheus-graphql-app/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Changelog

## 0.17.0 (Initial Release) - Unreleased
## 0.17.0 (Initial Release) - 25.02.2021
8 changes: 4 additions & 4 deletions morpheus-graphql-app/morpheus-graphql-app.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: ba0efa2fd025ed88ba20808738e201ed2b2c9d4500532e31187d71984d2753fe
-- hash: 78e70a5663436c9fe3f864a6d3a10e1a07dd8bae9058f6693b803c2cf08de583

name: morpheus-graphql-app
version: 0.16.0
version: 0.17.0
synopsis: Morpheus GraphQL Core
description: Build GraphQL APIs with your favourite functional language!
category: web, graphql
Expand Down Expand Up @@ -95,7 +95,7 @@ library
, containers >=0.4.2.1 && <0.7
, hashable >=1.0.0
, megaparsec >=7.0.0 && <10.0.0
, morpheus-graphql-core >=0.16.0 && <=0.17.0
, morpheus-graphql-core >=0.17.0 && <0.18.0
, mtl >=2.0 && <=3.0
, relude >=0.3.0
, scientific >=0.3.6.2 && <0.4
Expand Down Expand Up @@ -127,7 +127,7 @@ test-suite morpheus-test
, hashable >=1.0.0
, megaparsec >=7.0.0 && <10.0.0
, morpheus-graphql-app
, morpheus-graphql-core >=0.16.0 && <=0.17.0
, morpheus-graphql-core >=0.17.0 && <0.18.0
, mtl >=2.0 && <=3.0
, relude >=0.3.0
, scientific >=0.3.6.2 && <0.4
Expand Down
8 changes: 4 additions & 4 deletions morpheus-graphql-app/package.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: morpheus-graphql-app
version: 0.16.0
version: 0.17.0
github: "nalchevanidze/morpheus-graphql-app"
license: MIT
author: "Daviti Nalchevanidze"
category: web, graphql
synopsis: Morpheus GraphQL Core
synopsis: Morpheus GraphQL App
maintainer: "d.nalchevanidze@gmail.com"
homepage: https://morpheusgraphql.com
copyright: "(c) 2019 Daviti Nalchevanidze"
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies:
- mtl >= 2.0 && <= 3.0
- relude >= 0.3.0
- containers >= 0.4.2.1 && < 0.7
- morpheus-graphql-core >= 0.16.0 && <= 0.17.0
- morpheus-graphql-core >= 0.17.0 && < 0.18.0

library:
source-dirs: src
Expand All @@ -51,7 +51,7 @@ tests:
source-dirs: test
ghc-options: -Wall
dependencies:
- morpheus-graphql-core >= 0.16.0 && <= 0.17.0
- morpheus-graphql-core >= 0.17.0 && < 0.18.0
- morpheus-graphql-app
- tasty
- tasty-hunit
Expand Down
2 changes: 1 addition & 1 deletion morpheus-graphql-client/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 0.17.0 - Unreleased
## 0.17.0 - 25.02.2021

### Breaking changes

Expand Down
8 changes: 4 additions & 4 deletions morpheus-graphql-client/morpheus-graphql-client.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: 85c65ba8d89fb2f937f5f7311669f1aa339942da96336ce852a7efb55e8236ae
-- hash: e02463ebba831a7d044e68be7f21aa39b4fba099002f076f46478158b913b2a7

name: morpheus-graphql-client
version: 0.16.0
version: 0.17.0
synopsis: Morpheus GraphQL Client
description: Build GraphQL APIs with your favourite functional language!
category: web, graphql, client
Expand Down Expand Up @@ -67,7 +67,7 @@ library
aeson >=1.4.4.0 && <=1.6
, base >=4.7 && <5
, bytestring >=0.10.4 && <0.11
, morpheus-graphql-core >=0.16.0 && <0.17.0
, morpheus-graphql-core >=0.17.0 && <0.18.0
, mtl >=2.0 && <=3.0
, relude >=0.3.0
, template-haskell >=2.0 && <=3.0
Expand Down Expand Up @@ -98,7 +98,7 @@ test-suite morpheus-client-test
, bytestring >=0.10.4 && <0.11
, directory >=1.0
, morpheus-graphql-client
, morpheus-graphql-core >=0.16.0 && <0.17.0
, morpheus-graphql-core >=0.17.0 && <0.18.0
, mtl >=2.0 && <=3.0
, relude >=0.3.0
, tasty
Expand Down
4 changes: 2 additions & 2 deletions morpheus-graphql-client/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: morpheus-graphql-client
version: 0.16.0
version: 0.17.0
github: "nalchevanidze/morpheus-graphql"
license: MIT
author: "Daviti Nalchevanidze"
Expand All @@ -25,7 +25,7 @@ dependencies:
- text >= 1.2.3.0 && < 1.3
- aeson >= 1.4.4.0 && <= 1.6
- unordered-containers >= 0.2.8.0 && < 0.3
- morpheus-graphql-core >= 0.16.0 && < 0.17.0
- morpheus-graphql-core >= 0.17.0 && < 0.18.0
- template-haskell >= 2.0 && <= 3.0
- transformers >= 0.3.0.0 && < 1.0
- mtl >= 2.0 && <= 3.0
Expand Down
3 changes: 1 addition & 2 deletions morpheus-graphql-core/changelog.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Changelog

## 0.17.0 - Unreleased
## 0.17.0 - 25.02.2021

### New features

- `Data.Morpheus.Core` provides default GrapHQL type definitions with `internalSchema`
- exposed `Data.Morpheus.Internal.Ext`
- exposed `Data.Morpheus.Types.GQLWrapper` with `EncodeWrapper` and `DecodeWrapper` type-classes.

### Breaking changes

Expand Down
4 changes: 2 additions & 2 deletions morpheus-graphql-core/morpheus-graphql-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: b4b4073e842f5d85bd0dcb8c82bd54cf0c678a9c51b2f2366f7575c4f819e452
-- hash: 90068e1d18639f399f1e45aabe9e946400be315246c366b4277f1cae1888f54e

name: morpheus-graphql-core
version: 0.16.0
version: 0.17.0
synopsis: Morpheus GraphQL Core
description: Build GraphQL APIs with your favorite functional language!
category: web, graphql
Expand Down
2 changes: 1 addition & 1 deletion morpheus-graphql-core/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: morpheus-graphql-core
version: 0.16.0
version: 0.17.0
github: "nalchevanidze/morpheus-graphql"
license: MIT
author: "Daviti Nalchevanidze"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
-- hash: fe72288124611ef9e65cedffbd298df044067d6a161248bf86ee543611a1e73c
-- hash: 2efddb605a43d2d153897aa6dd3af8efa32fb38ad0b2e8f71d3c7f95298f1d85

name: morpheus-graphql-examples-client
version: 0.1.0
Expand Down Expand Up @@ -39,7 +39,7 @@ executable morpheus-client-example
build-depends:
base >=4.7 && <5
, bytestring >=0.10.4 && <0.11
, morpheus-graphql-client >=0.16.0
, morpheus-graphql-client >=0.17.0
, req >=2.1.0
, text >=1.2.3.0 && <1.3
default-language: Haskell2010

0 comments on commit f76f54e

Please sign in to comment.