Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support triple-quoted block strings #44

Closed
jeroen opened this issue Dec 19, 2016 · 2 comments
Closed

Support triple-quoted block strings #44

jeroen opened this issue Dec 19, 2016 · 2 comments

Comments

@jeroen
Copy link

jeroen commented Dec 19, 2016

@schloerke has found in our R bindings that the kitchen sink example produces invalid JSON:

curl -OL https://raw.githubusercontent.com/graphql/graphql-js/master/src/language/__tests__/kitchen-sink.graphql
./dump_json_ast kitchen-sink.graphql

The output has an invalid trailing comma (which you can validate on http://pro.jsonlint.com)

screen shot 2016-12-19 at 9 15 38 pm

@swolchok
Copy link
Contributor

Good catch! The null value is a special case that I missed because it has no fields besides the source location.

@dvergeylen
Copy link

dvergeylen commented Apr 12, 2018

Hello,

I am afraid the kitchen test changed a few months ago. Testing on a fresh clone I get the following output:

$ # Init
$ git clone https://github.com/graphql/libgraphqlparser
$ cd libgraphqlparser/
$ cmake .
$ make

$ # Test
$ curl -OL https://raw.githubusercontent.com/graphql/graphql-js/master/src/language/__tests__/kitchen-sink.graphql
$ ./dump_json_ast kitchen-sink.graphql
Parser failed with error: 49.58-59: Unterminated string

Am I doing something wrong?

Edit: diff between reference graphql-js test and hosted kitchen test:

 fragment frag on Friend {
-  foo(size: $size, bar: $b, obj: {key: "value"})
+  foo(size: $size, bar: $b, obj: {key: "value", block: """
+
+      block string uses \"""
+
+  """})
 }

@swolchok swolchok reopened this Apr 16, 2018
@swolchok swolchok changed the title Trailing comma's in kitchen sink test: Support triple-quoted block strings Jul 10, 2018
swolchok added a commit that referenced this issue Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants