rmosolgo / graphql-ruby

Ruby implementation of GraphQL
http://graphql-ruby.org
MIT License
5.37k stars 1.38k forks source link

[1.8.12] Block string parsing regression #2031

Closed swalkinshaw closed 5 years ago

swalkinshaw commented 5 years ago

It looks like https://github.com/rmosolgo/graphql-ruby/pull/1937 may have caused a regression in parsing block strings.

I ran into two issues trying to upgrade to 1.8.12:

  1. When parsing our existing schema from SDL (without block string comments), it broke when a description contained a double quote ". (parser error)
  2. Previously valid queries now throw a parser error.
mutation {
  myMutation(body: """{"title":"foo","properties":{}}""") {
    userErrors { field, message }
  }
}
{"errors"=>[{"message"=>"Parse error on \"{\" (STRING) at [2, 41]", "locations"=>[{"line"=>2, "column"=>41}]}]}

cc @pushrax

pushrax commented 5 years ago

To clarify, do you mean in 1. that switching to block string description syntax without changing the descriptions themselves resulted in a parse error, not that parsing the existing file with comment descriptions resulted in a parse error? Looking at the code on our end it appears this way; both 1. and 2. should be fixed by #2032.

swalkinshaw commented 5 years ago

not that parsing the existing file with comment descriptions resulted in a parse error

I bumped the gem version and then our schema dump task which triggered the parsing error. So no code was actually changed before that. But I'm guessing your PR will fix it anyway.

rmosolgo commented 5 years ago

Thanks for reporting this, @pushrax's fix is shipped in 1.8.13!