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

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

[nongnu] elpa/graphql-mode c643d53a4b 083/122: Don't send operationName


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode c643d53a4b 083/122: Don't send operationName when operation is an empty string
Date: Sat, 29 Jan 2022 08:03:37 -0500 (EST)

branch: elpa/graphql-mode
commit c643d53a4b1bfa654c361c22caea6964c5334a4e
Author: Artur Malabarba <artur@endlessparentheses.com>
Commit: Artur Malabarba <artur@endlessparentheses.com>

    Don't send operationName when operation is an empty string
    
    This happen, for instance, in the query below. That would cause
    "operationName": "" to be sent in the request json, which leads to
    errors in the backend.
    
        query {
          repositoryOwner(login: "Malabarba") {
            repositories(first: 100, isFork: false) {
              totalCount
              nodes { name }
            }
          }
        }
---
 graphql-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/graphql-mode.el b/graphql-mode.el
index c61768903e..0b5cea5e78 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -77,7 +77,7 @@
   "Put together a json like object with QUERY, OPERATION, and VARIABLES."
   (let* ((body '()))
     (push (cons 'query query) body)
-    (when operation
+    (when (and operation (not (string= operation "")))
       (push (cons 'operationName operation) body))
     (when variables
       (push (cons 'variables variables) body))



reply via email to

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