Fork me on GitHub
#pathom
<
2019-09-18
>
Abhinav Sharma04:09:22

Guys, excuse me if this has been asked before but I was wondering about something regarding Pathom 1. Is Pathom only meant for fetching data or is it possible to push the data as well? 2. For any API endpoint we need to write the parsers directly against the REST endpoint? Or is there a way to adapt the provided JS lib somehow

kszabo09:09:23

1. Mutations cover this need 2. Yes, generally you write a resolver which fetches your REST response, you usually fully flatten + qualify all attributes according to your own keywords

Abhinav Sharma11:09:53

Thanks @U08E8UGF7 for the pointer here 1. I guess that here’s the relevant doc https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/core/mutations.html And https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/connect-mutations.html Do you know of any other example of pushing data to a non-clojure server? 2. Got it 👍

kszabo11:09:28

1. yes, those are the correct docs what do you mean by pushing to non-clojure servers? In the context of Pathom that does not make sense to me

Abhinav Sharma11:09:11

Hmm, I was thinking about using Fulcro+Pathom with a firebase backend

kszabo11:09:57

Oh, in that case I would write a CLJS pathom remote for Fulcro and fire off Firebase calls in the mutation resolvers

kszabo11:09:27

I thouhgt you were planning to use Pathom for the backend

Abhinav Sharma11:09:17

Na, not yet - I’m inclined towards the pure frontend use cases.

Abhinav Sharma11:09:47

Then these firebase calls would need to be written against the REST interface right? https://firebase.google.com/docs/projects/api/reference/rest

kszabo11:09:03

probably, this is new territory for me as well

Abhinav Sharma11:09:28

Mm got it, your pointers have been a good help man!

🙏 4
wilkerlucio12:09:26

@U2BU9G0LT to help thinking about it, consider that Fulcro only communicates using EQL, so any communication has to go via it, this means keywords for requesting data and mutations to change the world (in any way, like sending messages to firebase operations), makes sense?

Abhinav Sharma12:09:39

Hi @U066U8JQJ, basically Pathom is the communication layer for Fulcro wrt outside world right, I get this. I guess to integrate with any rest/graphql backend it's important to teach this layer how to interpret the servers format right?

wilkerlucio12:09:38

yeah, correct, I prefer to say EQL because Pathom is an impl of it, but you can make your own if you want, that is no direct thing connecting fulcro and pathom, instead both talk EQL

wilkerlucio12:09:17

I think the distinction is important, because the language is formal and helps to understand the boundaries

Abhinav Sharma12:09:59

Cool, will remember this :) Thanks!