Release 0.5.0.0

This commit is contained in:
2019-08-14 08:49:07 +02:00
parent 045b6d15fb
commit f54e9451d2
4 changed files with 13 additions and 12 deletions

View File

@ -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