emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/graphql-mode 4bb868832f 078/122: Avoid double-encoding var


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode 4bb868832f 078/122: Avoid double-encoding variables in JSON
Date: Sat, 29 Jan 2022 08:03:35 -0500 (EST)

branch: elpa/graphql-mode
commit 4bb868832f539b93a3b88020f54a13036ac66a8f
Author: Chris Bowdon <chris.bowdon@polecat.com>
Commit: Chris Bowdon <chris.bowdon@polecat.com>

    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

[Prev in Thread] Current Thread [Next in Thread]