[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/graphql b3db1ff740 34/56: Response form should mirror i
From: |
ELPA Syncer |
Subject: |
[elpa] externals/graphql b3db1ff740 34/56: Response form should mirror input form when using macros |
Date: |
Sat, 29 Oct 2022 13:58:02 -0400 (EDT) |
branch: externals/graphql
commit b3db1ff740f16d51d75b1b8e4cde580e95e109d3
Author: Sean Allred <code@seanallred.com>
Commit: Sean Allred <code@seanallred.com>
Response form should mirror input form when using macros
This does introduce an extra level of parentheses when writing the
queries, but modern Lisp editors should make this trivial compared to
the gains in actually understanding the code.
---
graphql.el | 6 +++---
test/graphql-test.el | 8 ++++----
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/graphql.el b/graphql.el
index 3500f06770..78a0ffa726 100644
--- a/graphql.el
+++ b/graphql.el
@@ -162,15 +162,15 @@ parameter."
(defun graphql--genform-operation (args kind)
(pcase args
(`(,graph)
- `(graphql-encode '(,kind ,graph)))
+ `(graphql-encode '(,kind ,@graph)))
(`((,name) ,graph)
`(graphql-encode '(,kind :op-name ,name
- ,graph)))
+ ,@graph)))
(`((,name ,parameters) ,graph)
`(graphql-encode '(,kind :op-name ,name
:op-params ,parameters
- ,graph)))
+ ,@graph)))
(_ (error "bad form"))))
diff --git a/test/graphql-test.el b/test/graphql-test.el
index f80bba968a..2703f9cd3a 100644
--- a/test/graphql-test.el
+++ b/test/graphql-test.el
@@ -65,14 +65,14 @@
(should (string= (graphql-query (repository))
"query{repository}"))
(should (string= (graphql-query (test)
- (repository))
+ ((repository)))
"query test{repository}"))
(should (string= (graphql-query (test ((ep Episode !)
(review ReviewInput ! . 50)))
- (repository :arguments ((hello . ($ ep)))))
+ ((repository :arguments ((hello . ($ ep))))))
"query
test($ep:Episode!,$review:ReviewInput!=50){repository(hello:$ep)}"))
(should (string= (graphql-mutation (testMutation ((ep Episode . ((complex .
params)))))
- (change thing))
+ ((change thing)))
"mutation testMutation($ep:Episode!){change{thing}}")))
(ert-deftest encode-complicated ()
@@ -80,6 +80,6 @@
(with . "values")
(like . 50)))
(review ReviewInput ! . 50)))
- (repository :arguments ((hello . ($ ep)))))
+ ((repository :arguments ((hello . ($ ep))))))
"query
test($ep:Episode={complex:params,with:\"values\",like:50},$review:ReviewInput!=50){repository(hello:$ep)}")))
;;; graphql-test.el ends here
- [elpa] externals/graphql 44af7744d5 48/56: Ignore generated files, (continued)
- [elpa] externals/graphql 44af7744d5 48/56: Ignore generated files, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 6c4c5abb26 49/56: Remove defunct test/make.el, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql b64ab8d585 53/56: Do not suggest packaging `examples.el', ELPA Syncer, 2022/10/29
- [elpa] externals/graphql e2b309689f 55/56: Add 'clean' target, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 5ca5f50b5e 56/56: Update MELPA badge to new url, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql d1a8e478b3 21/56: Finish renaming test file, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 98f9131b27 29/56: Use graphql-encode instead of removed graphql--encode, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 32933981a9 32/56: Add support for specifying GraphQL lists using Lisp vector syntax, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 8d45c98e9f 24/56: Run tests on Travis, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 57a3dfe5bf 33/56: Correct capitalization, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql b3db1ff740 34/56: Response form should mirror input form when using macros,
ELPA Syncer <=
- [elpa] externals/graphql 3eb2416913 36/56: Make sure 'plain' cons cell keys are not cons cells themselves, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql d71e6b218c 39/56: Require subr-x for thread-last in examples.el, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 8b29e7e335 41/56: Fix emacs build on CI, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 093c761981 43/56: Switch to the real Emake, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 4338f9b280 44/56: Fix checkdoc and package-lint errors, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 4a6e055723 46/56: Test 26.1 on CI, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql ea85c2b32b 47/56: Allow makefile to be run locally without duplication, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql a9ab8d7186 50/56: Fix version check, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 672dd9ebd7 51/56: Release version 0.1.1, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql c16c8e9a1b 52/56: Add badges, ELPA Syncer, 2022/10/29