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

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

[nongnu] elpa/graphql-mode c3471642f5 072/122: Merge pull request #19 fr


From: ELPA Syncer
Subject: [nongnu] elpa/graphql-mode c3471642f5 072/122: Merge pull request #19 from cbowdon/master
Date: Sat, 29 Jan 2022 08:03:34 -0500 (EST)

branch: elpa/graphql-mode
commit c3471642f5b7f9363e6254b03b4e46795edc8147
Merge: 36b1a4ed9f 22cb9d4594
Author: David Vázquez Púa <davazp@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #19 from cbowdon/master
    
    Support customizing the headers sent with the request
---
 graphql-mode.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/graphql-mode.el b/graphql-mode.el
index 38b72275b5..5387c3c9fc 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -67,6 +67,12 @@
   :type 'file
   :group 'graphql)
 
+(defcustom graphql-headers '(("Content-Type" . "application/json"))
+  "Headers to send to the graphql endpoint."
+  :tag "GraphQL"
+  :type 'list
+  :group 'graphql)
+
 (defun graphql-encode-json (query &optional operation variables)
   "Put together a json like object with QUERY, OPERATION, and VARIABLES."
   (let* ((body '()))
@@ -106,7 +112,7 @@ Please install it and try again."))
                    url
                     :type "POST"
                     :data body
-                    :headers '(("Content-Type" . "application/json"))
+                    :headers graphql-headers
                     :parser 'json-read
                     :sync t
                     :complete (lambda (&rest _)



reply via email to

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