branch: externals/graphql commit 3bf43e2ad18cc3c0325ff647c37fa9dbb2641486 Author: Sean Allred <c...@seanallred.com> Commit: Sean Allred <c...@seanallred.com>
Use real names of things --- README.md | 3 ++- graphql.el | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 24957432e2..ac7e446cf6 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,5 @@ GraphQL.el GraphQL.el provides a set of generic functions for interacting with GraphQL web services. -See also [`graphql-mode`](https://github.com/davazp/graphql-mode). +See also [`graphql-mode`](https://github.com/davazp/graphql-mode) and +[this brief overview](http://graphql.org/learn/) on GraphQL syntax. diff --git a/graphql.el b/graphql.el index aaca889459..fac829d549 100644 --- a/graphql.el +++ b/graphql.el @@ -76,21 +76,21 @@ (graphql--encode-list g) (pcase (graphql--get-keys g) (`(,keys ,graph) - (let ((root (car graph)) + (let ((object (car graph)) (name (alist-get :name keys)) (arguments (alist-get :arguments keys)) - (rest (cdr graph))) + (fields (cdr graph))) (concat - (symbol-name root) + (symbol-name object) (when arguments ;; Format arguments "key:value, ..." (format "(%s)" (mapconcat #'graphql--encode-parameter-pair arguments ","))) (when name (format " %S") name) - (when rest + (when fields (format " { %s }" - (mapconcat #'graphql--encode rest " "))))))))) + (mapconcat #'graphql--encode fields " "))))))))) (defun graphql-encode (g) "Encode G as a GraphQL string."