Function: ghub-query

ghub-query is a byte-compiled function defined in ghub-graphql.el.

Signature

(ghub-query QUERY &optional VARIABLES &key UNTIL NARROW HEADERS PAGINATE CALLBACK ERRORBACK NOERROR SYNCHRONOUS USERNAME AUTH HOST FORGE)

Source Code

;; Defined in ~/.emacs.d/elpa/ghub-20260401.1239/ghub-graphql.el
(cl-defun ghub-query
    (query &optional variables
           &key until narrow headers paginate
           callback errorback noerror synchronous
           username auth host forge)
  (declare (indent defun))
  (unless forge
    (setq forge 'github))
  (unless host
    (setq host (ghub--host forge)))
  (unless (or username (stringp auth) (eq auth 'none))
    (setq username (ghub--username host forge)))
  (when (eq callback 'pp)
    (setq callback #'ghub--graphql-pp-response)
    (setq noerror t))
  (ghub--graphql-retrieve
   (ghub--make-graphql-req
    :url         (ghub--encode-url
                  host (if (eq forge 'gitlab) "/api/graphql" "/graphql"))
    :method      "POST"
    :headers     (ghub--headers headers host auth username forge)
    :handler     #'ghub--graphql-handle-response
    :query       query
    :variables   variables
    :until       until
    :buffer      (current-buffer)
    :narrow      narrow
    :paginate    (or paginate
                     (and-let* ((p (and (eq auth 'forge)
                                        (fboundp 'magit-get)
                                        (magit-get "forge.graphqlItemLimit"))))
                       (string-to-number p)))
    :noerror     noerror
    :synchronous synchronous
    :callback    callback
    :errorback   errorback)))