branch: elpa/graphql-mode
commit 4bb868832f539b93a3b88020f54a13036ac66a8f
Author: Chris Bowdon <[email protected]>
Commit: Chris Bowdon <[email protected]>

    Avoid double-encoding variables in JSON
    
    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.
---
 graphql-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/graphql-mode.el b/graphql-mode.el
index 197867d027..0944537a6b 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -187,7 +187,7 @@ Please install it and try again."))
            (file-exists-p filename))
       (condition-case nil
           (progn (get-buffer-create (find-file-noselect filename))
-                 (json-encode (json-read-file filename)))
+                 (json-read-file filename))
         (error nil))
     nil))
 

Reply via email to