Document AST.Document.escape

This commit is contained in:
Eugen Wissner 2021-02-11 12:02:08 +01:00
parent 2839b28590
commit 1e8405a6d6
2 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,8 @@ The format is based on
and this project adheres to and this project adheres to
[Haskell Package Versioning Policy](https://pvp.haskell.org/). [Haskell Package Versioning Policy](https://pvp.haskell.org/).
## [Unreleased]
## [0.11.1.0] - 2021-02-07 ## [0.11.1.0] - 2021-02-07
### Added ### Added
- `Validate.Rules`: - `Validate.Rules`:
@ -413,6 +415,7 @@ and this project adheres to
### Added ### Added
- Data types for the GraphQL language. - Data types for the GraphQL language.
[Unreleased]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=master&rev_to=v0.11.1.0
[0.11.1.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.11.1.0&rev_to=v0.11.0.0 [0.11.1.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.11.1.0&rev_to=v0.11.0.0
[0.11.0.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.11.0.0&rev_to=v0.10.0.0 [0.11.0.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.11.0.0&rev_to=v0.10.0.0
[0.10.0.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.10.0.0&rev_to=v0.9.0.0 [0.10.0.0]: https://www.caraus.tech/projects/pub-graphql/repository/23/diff?rev=v0.10.0.0&rev_to=v0.9.0.0

View File

@ -226,6 +226,12 @@ type TypeCondition = Name
-- ** Input Values -- ** Input Values
-- | Escapes a single character according to the GraphQL escaping rules for
-- double-quoted string values.
--
-- Characters, that should be escaped, are written as escaped characters with a
-- backslash or Unicode with an \"\\u\". Other characters are returned as
-- strings.
escape :: Char -> String escape :: Char -> String
escape char' escape char'
| char' == '\\' = "\\\\" | char' == '\\' = "\\\\"
@ -318,13 +324,13 @@ instance Functor ObjectField where
-- Each operation can include a list of variables: -- Each operation can include a list of variables:
-- --
-- @ -- @
-- query (protagonist: String = "Zarathustra") { -- query (protagonist: String = \"Zarathustra\") {
-- getAuthor(protagonist: $protagonist) -- getAuthor(protagonist: $protagonist)
-- } -- }
-- @ -- @
-- --
-- This query defines an optional variable @protagonist@ of type @String@, -- This query defines an optional variable @protagonist@ of type @String@,
-- its default value is "Zarathustra". If no default value is defined and no -- its default value is \"Zarathustra\". If no default value is defined and no
-- value is provided, a variable can still be @null@ if its type is nullable. -- value is provided, a variable can still be @null@ if its type is nullable.
-- --
-- Variables are usually passed along with the query, but not in the query -- Variables are usually passed along with the query, but not in the query