andreas / ocaml-graphql-server

GraphQL servers in OCaml
MIT License
622 stars 60 forks source link

Support block strings in the parser #198

Closed dwwoelfel closed 3 years ago

dwwoelfel commented 3 years ago

Adds parsing support for GraphQL's block string syntax.

With this change, the message arg in the following query will be parsed as "Hello,\n World!\n\nYours,\n GraphQL.", per the spec.

mutation {
  sendEmail(message: """
    Hello,
      World!

    Yours,
      GraphQL.
  """)
}

Test cases are lifted from the block string tests in graphql-js.

andreas commented 3 years ago

Thanks @dwwoelfel! 🏆