Last active
February 17, 2021 16:37
-
-
Save matheusfrancisco/09de37256dd94d8935e4d3be64adf7c9 to your computer and use it in GitHub Desktop.
pathom.clj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns buzzlabs.scraper.actions | |
(:require | |
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir] | |
[com.wsscode.pathom3.interface.eql :as p.eql] | |
[com.wsscode.pathom3.interface.async.eql :as pa.eql] | |
[com.wsscode.pathom3.connect.indexes :as pci] | |
[com.wsscode.pathom3.connect.operation :as pco] | |
[com.wsscode.pathom3.interface.smart-map :as psm] | |
[com.wsscode.pathom3.connect.built-in.resolvers :as pbir] | |
[clj-http.cookies :as cookies] | |
[clj-http.client :as http] | |
[clojure.data.json :as json] | |
[taoensso.timbre :refer [info]] | |
[net.cgrand.enlive-html :as html] | |
[clojure.string :as st] | |
[clojure.tools.reader.edn :as edn] | |
;[promesa.core :as p] | |
[taoensso.timbre :as log] | |
[clojure.pprint :as pp])) | |
;; what happening? | |
(pco/defresolver ex11 [] | |
{::pco/output [:ex.xico/http]} | |
{:ex.xico/http (http/post "https://httpbin.org/post" {:headers {:Content-Type "application/json"}})}) | |
(pco/defresolver ex12 [] | |
{::pco/input [:ex.xico/c]} | |
{:ex.xico/cc (http/post "https://url1.org/post" {:headers {:Content-Type "application/json"}})}) | |
(pco/defmutation mutation-ex3 [] | |
{:ex.xico/cc (http/post "https://url2.org/post" {:headers {:Content-Type "application/json"}})}) | |
(def env1 (-> | |
(pci/register | |
[ex11 | |
ex12 | |
mutation-ex3]) | |
(psm/with-error-mode ::psm/error-mode-loud))) | |
;; note in line 41 with psm/with-error-mode if I comment #_(psm/...) this line, the mutation will be work. | |
;; with this line(41) uncommented the invoke at line 47 return an error, I put in first comment bellow | |
(:ex.xico/http (psm/smart-map env1)) | |
(p.eql/process env1 [`(mutation-ex3)]) |
Author
matheusfrancisco
commented
Feb 17, 2021
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment