branch: externals/graphql commit f43b1da554133ce8da64be38427c17bbb06d5961 Author: Sean Allred <c...@seanallred.com> Commit: Sean Allred <c...@seanallred.com>
Fix *-parameter-spec behavior when REQUIRED is omitted --- graphql.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/graphql.el b/graphql.el index e57d24c8a9..e3a0220906 100644 --- a/graphql.el +++ b/graphql.el @@ -76,11 +76,15 @@ required. A value of `!' is recommended. A non-nil value for DEFAULT will provide a default value for the parameter." - (let ((last (last spec))) - (graphql--encode-parameter (car spec) - (cadr spec) - (car last) - (cdr last)))) + (if (eq (last spec) (nthcdr 2 spec)) + (graphql--encode-parameter (nth 0 spec) + (nth 1 spec) + (car (last spec)) + (cdr (last spec))) + (graphql--encode-parameter (nth 0 spec) + (nth 1 spec) + nil + (nthcdr 2 spec)))) (defun graphql--encode-parameter (name type &optional required default) (format "$%s:%s%s%s" (symbol-name name)