Fork me on GitHub
Daniel Craig19:01:02

What's the correct way to provide variables when making a query to lacinia using re-graph? This is the example given in the readme but I can't seem to figure out how the 'id' field is populated.

;; perform a query, with the response sent to the callback event provided
(re-frame/dispatch [::re-graph/query
                    :my-query-id         ;; unique id for this query
                    "{ things { id } }"  ;; your graphql query
                    {:some "variable"}   ;; arguments map
                    [::on-thing]])       ;; callback event when response is recieved

Daniel Craig19:01:14

@U26FJ5FDM I see

  (fn [cofx [_ username password]]
    {:db       (assoc-in (:db cofx) [:login-status :username] username)
     :dispatch [::re-graph/mutate
                "($username: String! $password: String!){get_account(username: $username password: $password) {reason iban token}}"
                {:username username :password password}
at I'll try to use this example to figure it out

Daniel Craig19:01:00

I got it figured out! Sorry to pester!

👍 1