summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md7
-rw-r--r--graphql.cabal4
-rw-r--r--package.yaml2
-rw-r--r--src/Language/GraphQL/Encoder.hs12
4 files changed, 13 insertions, 12 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2aab3a..efdf1c6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,12 +1,12 @@
# Change Log
All notable changes to this project will be documented in this file.
-## [Unreleased]
+## [0.5.0.0] - 2019-08-14
### Added
- `executeWithName` executes an operation with the given name.
-- Export `Language.GraphQL.Encoder.definition`.
+- Export `Language.GraphQL.Encoder.definition`,
+ `Language.GraphQL.Encoder.type'` and `Language.GraphQL.Encoder.directive`.
- Export `Language.GraphQL.Encoder.value`. Escapes \ and " in strings now.
-- Export `Language.GraphQL.Encoder.type'`.
### Changed
- `Operation` includes now possible operation name which allows to support
@@ -70,6 +70,7 @@ All notable changes to this project will be documented in this file.
### Added
- Data types for the GraphQL language.
+[0.5.0.0]: https://github.com/caraus-ecms/graphql/compare/v0.4.0.0...v0.5.0.0
[0.4.0.0]: https://github.com/caraus-ecms/graphql/compare/v0.3...v0.4.0.0
[0.3]: https://github.com/caraus-ecms/graphql/compare/v0.2.1...v0.3
[0.2.1]: https://github.com/caraus-ecms/graphql/compare/v0.2...v0.2.1
diff --git a/graphql.cabal b/graphql.cabal
index 0a43ff4..b8d699e 100644
--- a/graphql.cabal
+++ b/graphql.cabal
@@ -4,10 +4,10 @@ cabal-version: 1.12
--
-- see: https://github.com/sol/hpack
--
--- hash: cb68243309f47fc44768d14981c4f6f8b3f1bb9dc37dd17a63996418d6aac375
+-- hash: 6598c2424405b7a92a4672ad7d1a4e8ad768ea47bf3ed0c3c5ae51bac8730301
name: graphql
-version: 0.4.0.0
+version: 0.5.0.0
synopsis: Haskell GraphQL implementation
description: This package provides a rudimentary parser for the <https://graphql.github.io/graphql-spec/June2018/ GraphQL> language.
category: Language
diff --git a/package.yaml b/package.yaml
index 814d8c3..000fdf9 100644
--- a/package.yaml
+++ b/package.yaml
@@ -1,5 +1,5 @@
name: graphql
-version: 0.4.0.0
+version: 0.5.0.0
synopsis: Haskell GraphQL implementation
description:
This package provides a rudimentary parser for the
diff --git a/src/Language/GraphQL/Encoder.hs b/src/Language/GraphQL/Encoder.hs
index 71c7145..11115b1 100644
--- a/src/Language/GraphQL/Encoder.hs
+++ b/src/Language/GraphQL/Encoder.hs
@@ -5,6 +5,7 @@
module Language.GraphQL.Encoder
( Formatter
, definition
+ , directive
, document
, minified
, pretty
@@ -162,17 +163,16 @@ fragmentDefinition formatter (FragmentDefinition name tc dirs sels)
<> eitherFormat formatter " " mempty
<> selectionSet formatter sels
--- * Directives
-
-directives :: Formatter -> Directives -> Text
-directives formatter@(Pretty _) = Text.Lazy.cons ' ' . spaces (directive formatter)
-directives Minified = spaces (directive Minified)
+-- * Miscellaneous
+-- | Converts a 'Directive' into a string.
directive :: Formatter -> Directive -> Text
directive formatter (Directive name args)
= "@" <> Text.Lazy.fromStrict name <> optempty (arguments formatter) args
--- * Miscellaneous
+directives :: Formatter -> Directives -> Text
+directives formatter@(Pretty _) = Text.Lazy.cons ' ' . spaces (directive formatter)
+directives Minified = spaces (directive Minified)
-- | Converts a 'Value' into a string.
value :: Formatter -> Value -> Text