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

Order of parsing with escapes returns errors depending on position in the query #588

Closed
adkron opened this issue Jul 31, 2018 · 1 comment

Comments

@adkron
Copy link
Contributor

adkron commented Jul 31, 2018

Environment

Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Elixir 1.6.0 (compiled with OTP 20)
absinthe 1.4.12
absinthe_relay 1.4.3

Including a test on the master branch.

Expected behavior

There is an example test for the master branch at BinaryNoggin@4573a9f

I expect that the order of parsing with escape characters to parse no matter the position of the keys and values.

Actual behavior

 {:error,
             %Absinthe.Blueprint{
               adapter: nil,
               directives: [],
               errors: [],
               execution: %Absinthe.Blueprint.Execution{
                 acc: %{},
                 adapter: nil,
                 context: %{},
                 fields_cache: %{},
                 fragments: %{},
                 result: nil,
                 root_value: %{},
                 schema: nil,
                 validation_errors: [
                   %Absinthe.Phase.Error{
                     extra: %{},
                     locations: [%{column: 0, line: 1}],
                     message: "illegal: \") { name } }",
                     path: [],
                     phase: Absinthe.Phase.Parse
                   }
                 ]
               },
               flags: %{},
               fragments: [],
               input: "{ post(title: \"title\\\\\", body: \"body\") { name } }",
               name: nil,
               operations: [],
               result: %{},
               schema: nil,
               types: []
             }}

Relevant Schema/Middleware Code

BinaryNoggin@4573a9f

I created a test to show this happening.

@adkron
Copy link
Contributor Author

adkron commented Aug 1, 2018

There is no error if the input has a return after each item. It is a small workaround, but it might work for some people.

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

1 participant