[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/graphql-mode 74ee772a62 087/122: Merge pull request #26 fr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/graphql-mode 74ee772a62 087/122: Merge pull request #26 from Malabarba/master |
Date: |
Sat, 29 Jan 2022 08:03:37 -0500 (EST) |
branch: elpa/graphql-mode
commit 74ee772a62103fe3ec4f291854a0604dd3f5bb9e
Merge: ebd6502c09 4c942986fa
Author: David Vázquez Púa <davazp@gmail.com>
Commit: GitHub <noreply@github.com>
Merge pull request #26 from Malabarba/master
Also insert response headers in the buffer (with comment face)
---
graphql-mode.el | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index f39aa4d5ce..cdac300b3b 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -110,20 +110,18 @@ VARIABLES list of variables for query operation"
(error "graphql-post-request needs the request package. \
Please install it and try again."))
(let* ((body (graphql-encode-json query operation variables))
- (headers (append '(("Content-Type" . "application/json"))
graphql-extra-headers))
- (response (request
- url
- :type "POST"
- :data body
- :headers headers
- :parser 'json-read
- :sync t
- :complete (lambda (&rest _)
- (message "%s" (if (string-equal "" operation)
- url
- (format "%s?operationName=%s"
- url operation)))))))
- (json-encode (request-response-data response))))
+ (headers (append '(("Content-Type" . "application/json"))
graphql-extra-headers)))
+ (request url
+ :type "POST"
+ :data body
+ :headers headers
+ :parser 'json-read
+ :sync t
+ :complete (lambda (&rest _)
+ (message "%s" (if (string-equal "" operation)
+ url
+ (format "%s?operationName=%s"
+ url operation)))))))
(defun graphql-beginning-of-query ()
"Move the point to the beginning of the current query."
@@ -213,8 +211,13 @@ Please install it and try again."))
;;
;; (when (fboundp 'json-mode)
;; (json-mode))
- (insert response)
- (json-pretty-print-buffer))))
+ (insert (json-encode (request-response-data response)))
+ (json-pretty-print-buffer)
+ (goto-char (point-max))
+ (insert "\n\n"
+ (propertize (request-response--raw-header response)
+ 'face 'font-lock-comment-face
+ 'font-lock-face 'font-lock-comment-face)))))
;; If the query was successful, then save the value of graphql-url
;; in the current buffer (instead of the introduced local
;; binding).
- [nongnu] elpa/graphql-mode 052491e05f 048/122: update variable encoding in post body, ask operation Name if needed, (continued)
- [nongnu] elpa/graphql-mode 052491e05f 048/122: update variable encoding in post body, ask operation Name if needed, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 83cba48fd8 014/122: Remove unnecessary syntax, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 6017afac92 017/122: Rename graphql.el to graphql-mode.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 7482c1b100 025/122: Add basic commentary, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 36b1a4ed9f 070/122: Merge pull request #16 from emacsjanitors/no-request, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4b0134a19a 050/122: forget docstring, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 5f2ee4b3b3 024/122: Add melpa badge, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 8e58196e21 023/122: Merge pull request #1 from syohex/fix-package, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 2ee89d4e05 080/122: Fix Error during redisplay, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 0b4152d485 051/122: Fix tests to use variables, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 74ee772a62 087/122: Merge pull request #26 from Malabarba/master,
ELPA Syncer <=
- [nongnu] elpa/graphql-mode ebd6502c09 085/122: Merge pull request #25 from Malabarba/operation-bug, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode f1be68cea4 108/122: Add key binding for editing headers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 3cbaa5ef35 041/122: Add multiple queries definition and variables support, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4c942986fa 086/122: Also insert response headers in the buffer (with comment face), ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 6f6b303af4 084/122: Merge pull request #24 from Malabarba/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 301a218674 090/122: Enable json-mode for the output buffer., ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode fb84a08434 069/122: Make the dependency on request optional, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode e757919fe3 093/122: Merge pull request #30 from conao3/fix-warning, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 2371316a75 116/122: Merge pull request #42 from adimit/headers-buffer, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode c176b16a41 112/122: Fix header line documentation, ELPA Syncer, 2022/01/29