[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/graphql adf95c1d92 16/56: Compress output
From: |
ELPA Syncer |
Subject: |
[elpa] externals/graphql adf95c1d92 16/56: Compress output |
Date: |
Sat, 29 Oct 2022 13:57:53 -0400 (EDT) |
branch: externals/graphql
commit adf95c1d920bb94b6bb8c0a5fea506ac20b03f08
Author: Sean Allred <code@seanallred.com>
Commit: Sean Allred <code@seanallred.com>
Compress output
---
graphql.el | 6 +++---
test/graphql.el-test.el | 23 +++++++++++++----------
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/graphql.el b/graphql.el
index a750f8c025..e57d24c8a9 100644
--- a/graphql.el
+++ b/graphql.el
@@ -82,12 +82,12 @@ parameter."
(car last)
(cdr last))))
(defun graphql--encode-parameter (name type &optional required default)
- (format "$%s: %s%s%s"
+ (format "$%s:%s%s%s"
(symbol-name name)
(symbol-name type)
(if required "!" "")
(if default
- (concat " = " (graphql--encode-argument-value default))
+ (concat "=" (graphql--encode-argument-value default))
"")))
(defun graphql--get-keys (g)
@@ -123,7 +123,7 @@ parameter."
(format "(%s)"
(mapconcat #'graphql--encode-parameter-spec params ",")))
(when fields
- (format " { %s }"
+ (format "{%s}"
(mapconcat #'graphql-encode fields " ")))))))))
(defun graphql--genform-operation (args kind)
diff --git a/test/graphql.el-test.el b/test/graphql.el-test.el
index 743e86d313..f692c91085 100644
--- a/test/graphql.el-test.el
+++ b/test/graphql.el-test.el
@@ -4,21 +4,21 @@
(should (string= (graphql-encode
'(query
hello-world))
- "query { hello-world }"))
+ "query{hello-world}"))
(should (string= (graphql-encode
'(query
:arguments ((one . 1)
(two . "2"))
hello-world))
- "query(one:1,two:\"2\") { hello-world }"))
+ "query(one:1,two:\"2\"){hello-world}"))
(should (string= (graphql-encode
'(query
:arguments ((one . ($ variableForOne))
(two . "2"))
hello-world))
- "query(one:$variableForOne,two:\"2\") { hello-world }")))
+ "query(one:$variableForOne,two:\"2\"){hello-world}")))
(ert-deftest encode-recursive ()
(should (string= (graphql-encode
@@ -26,7 +26,7 @@
(repository
:arguments ((owner . "my-owner")
(name . "my-repo-name")))))
- "query {
repository(owner:\"my-owner\",name:\"my-repo-name\") }"))
+
"query{repository(owner:\"my-owner\",name:\"my-repo-name\")}"))
(should (string= (graphql-encode
'(query
@@ -37,8 +37,8 @@
:arguments ((first . 20))
(edges (node number title url))))))
(concat
- "query {
repository(owner:\"my-owner\",name:\"my-repo-name\") "
- "{ issues(first:20) { edges { node { number title url } }
} } }")))
+
"query{repository(owner:\"my-owner\",name:\"my-repo-name\")"
+ "{issues(first:20){edges{node{number title url}}}}}")))
(should (string= (graphql-encode
'(addReaction :arguments ((input . ((subjectId .
"MDU6SXNzdWUxNzc2MzA3Mjk=")
@@ -46,8 +46,11 @@
"addReaction(input:{subjectId:\"MDU6SXNzdWUxNzc2MzA3Mjk=\",content:HOORAY})")))
(ert-deftest encode-query ()
- (string= (graphql-query (test ((ep Episode !)
- (review ReviewInput ! . "fifty")))
- (repository))
- "query test($ep: Episode!,$review: ReviewInput! = \"fifty\") {
repository }"))
+ (should (string= (graphql-query (test)
+ (repository))
+ "query test { repository }"))
+ (should (string= (graphql-query (test ((ep Episode !)
+ (review ReviewInput ! . 50)))
+ (repository :arguments ((hello . ($ ep)))))
+ "query test($ep:Episode!,$review:ReviewInput!=50) {
repository(hello:$ep) }")) )
;;; graphql.el-test.el ends here
- [elpa] branch externals/graphql created (now 5ca5f50b5e), ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 1026c76d30 01/56: Initial commit, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 9d4179cd4a 04/56: Simplify handling of fields, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 335ec3a9c5 08/56: More appropriate function names for argument encoding, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql a8067839b6 10/56: Rename `graphql--encode-argument-pair' to `*-spec', ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 1f4f1a61c9 11/56: Remove graphql-encode and replace it with graphql--encode, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql adf95c1d92 16/56: Compress output,
ELPA Syncer <=
- [elpa] externals/graphql f9dc451ae6 18/56: Simplify object encoding, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 0756399fc9 22/56: Test unnamed query, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql b0bd6c5fd8 02/56: Create DSL and basic encoder, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql fcc32d3d71 03/56: Simplify handling of spacing optional elements, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 3bf43e2ad1 05/56: Use real names of things, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 24d278dd43 06/56: Add support for variables in object parameters, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 4d2837ddbe 07/56: Fix format bug for :name, ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 210fed6a12 09/56: More appropriate name for `:name', ELPA Syncer, 2022/10/29
- [elpa] externals/graphql d299be77da 12/56: Tweak handling for numbers when encoding argument values., ELPA Syncer, 2022/10/29
- [elpa] externals/graphql 08fb4fcf12 13/56: Add support for operation parameters via `:op-params', ELPA Syncer, 2022/10/29