[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/graphql-mode de4b2e8117 039/122: Remember graphql-url valu
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/graphql-mode de4b2e8117 039/122: Remember graphql-url value only if the query is successful |
Date: |
Sat, 29 Jan 2022 08:03:31 -0500 (EST) |
branch: elpa/graphql-mode
commit de4b2e8117f26e5ad98387f715ce4c6cffa40c73
Author: David Vazquez Pua <dvazquezpua@deloitte.nl>
Commit: David Vazquez Pua <dvazquezpua@deloitte.nl>
Remember graphql-url value only if the query is successful
This fixes #6
---
graphql-mode.el | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/graphql-mode.el b/graphql-mode.el
index cc14d75a6f..0dd61afdb7 100644
--- a/graphql-mode.el
+++ b/graphql-mode.el
@@ -99,17 +99,22 @@ response from the server."
(defun graphql-send-query ()
(interactive)
- (unless graphql-url
- (setq graphql-url (read-string "GraphQL URL: " )))
- (let* ((query (buffer-substring-no-properties (point-min) (point-max)))
- (response (graphql--query query)))
- (with-current-buffer-window
- "*GraphQL*" 'display-buffer-pop-up-window nil
- (erase-buffer)
- (when (fboundp 'json-mode)
- (json-mode))
- (insert response)
- (json-pretty-print-buffer))))
+ (let ((url (or graphql-url (read-string "GraphQL URL: " ))))
+ (let ((graphql-url url))
+ (let* ((query (buffer-substring-no-properties (point-min) (point-max)))
+ (response (graphql--query query)))
+ (with-current-buffer-window
+ "*GraphQL*" 'display-buffer-pop-up-window nil
+ (erase-buffer)
+ (when (fboundp 'json-mode)
+ (json-mode))
+ (insert response)
+ (json-pretty-print-buffer))))
+ ;; If the query was successful, then save the value of graphql-url
+ ;; in the current buffer (instead of the introduced local
+ ;; binding).
+ (setq graphql-url url)
+ nil))
- [nongnu] branch elpa/graphql-mode created (now 9740e4027b), ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 14bbd1917e 032/122: Update copyright notice, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 12ab2d0eb5 060/122: Merge pull request #13 from timoweave/next, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode de4b2e8117 039/122: Remember graphql-url value only if the query is successful,
ELPA Syncer <=
- [nongnu] elpa/graphql-mode ead2f85e12 047/122: add error handling, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 22cb9d4594 071/122: Support customizing the headers sent with the request, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 1210279ff4 063/122: Add keywords only completion, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4bb868832f 078/122: Avoid double-encoding variables in JSON, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode a665c9514a 054/122: fix docstring, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 4c87cdab57 018/122: Fix: make the graphql-url buffer-local before the mode is enabled, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 319dfd97d7 011/122: Define graphql-send-query, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode eed3c6ca1c 036/122: Create sample GraphQL server, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 404aa31258 104/122: Save json to graphql-edit-headers, ELPA Syncer, 2022/01/29
- [nongnu] elpa/graphql-mode 16c3d63521 002/122: First commit, ELPA Syncer, 2022/01/29