branch: elpa/graphql-mode
commit af9b235e14ffe5c9fd6ac2d58e1ea5be3becbba7
Author: Aleksandar Dimitrov <[email protected]>
Commit: Aleksandar Dimitrov <[email protected]>
Add content of graphql-extra-headers to buffer
---
graphql-mode.el | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index 8c26da5925..93490a589f 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -400,10 +400,14 @@ when sending a request."
(let ((extra-headers-buffer
(concat "*Graphql Headers for " (buffer-file-name
(buffer-base-buffer)) "*")))
(pop-to-buffer extra-headers-buffer)
+ (if graphql-extra-headers
+ (progn
+ (insert (json-serialize graphql-extra-headers))
+ (json-pretty-print (point-min) (point-max))
+ (goto-char (point-min))))
(when (fboundp 'json-mode)
(json-mode))
- (graphql-edit-headers-mode))
- (message "TODO: populate with graphql extra headers content"))
+ (graphql-edit-headers-mode)))
(defun graphql-edit-headers-buffer-p ()
"Non-nil when current buffer is a header editing buffer."