davazp / graphql-mode

An Emacs mode for GraphQL
GNU General Public License v3.0
162 stars 31 forks source link

Avoid double-encoding variables in JSON #22

Closed cbowdon closed 5 years ago

cbowdon commented 5 years ago

Previous behaviour produced requests like:

{"variables": "{\"id\": 42}", "query": ...}

i.e. variables was stringified JSON within the JSON object. This isn't supported by all GraphQL server implementations, so this change produces the structure:

{"variables": {"id": 42}, "query": ...}

which is more widely supported.

davazp commented 5 years ago

Thanks