Fork me on GitHub
#fulcro
<
2021-02-17
>
hadils00:02:59

N00b question. I have created an unholy alliance between fulcro-rad-demo and the React Native demo code. I have jumped through several hurdles already but my EQL and Pathom skills are in their infancy. I do not understand why the below query is causing the RAD demo parser to throw an exception:

[{:com.wsscode.pathom.connect/indexes [:com.wsscode.pathom.connect/idents :com.wsscode.pathom.connect/index-io :com.wsscode.pathom.connect/autocomplete-ignore]}]
Can anyone point me in the right direction? Thanks! P.S. This query is coming from Fulcro Inspect Electron. I am sure that my parser is incorrect in this case.

alex-eberts00:02:06

@hadilsabbagh18 When you say “the query is coming from Fulcro Inspect Electron” do you mean that you entered that query in the EQL tab and got the expected result?

hadils00:02:57

No @alex-eberts. This is a query that Fulcro Inspect Electron sends to load the Pathom indexes for the EQL window.

alex-eberts00:02:09

So where are you getting that query from? The network tab?

hadils00:02:58

No the load Pathom index button on the EQL tab. I think I don't have transit properly configured in my code, based on the error message:

body was either not transit or you have not installed the correct transit read/write handlers."

alex-eberts00:02:11

It’s possible that you may be using an older version of the rad demo. There was a PR in Dec that fixed an issue with the index not loading: https://github.com/fulcrologic/fulcro-rad-demo/pull/18/commits/819a2395c935f4c4675d0a83c29518daa2fd9516

alex-eberts00:02:37

When did you pull the RAD-demo?

hadils00:02:14

Last week.

hadils00:02:47

Let me look into that though

hadils00:02:39

That code in in my demo.

alex-eberts00:02:54

Is your code on a public repo that I can take a look at? Have you checked with the guys in the #pathom channel to see if this is a known problem?

hadils00:02:04

The repo is not public, unfortunately.

hadils00:02:27

I will keep digging.

hadils00:02:45

Thanks for you help @alex-eberts.

alex-eberts00:02:17

Sorry I couldn’t be of more help - good luck!

tony.kay01:02:12

So, my first question @hadilsabbagh18 is “does it work with the stock demo?” I have not tried in a while, but it should. If the answer to that is “yes”, then my guess is that you changed the parser in some incompatible way. If the answer is “no”, then it is an oversight in the demo. Also, did you change versions of things? What version of Pathom? Fulcro assumes Pathom 2.x

Jakub Holý (HolyJak)15:02:33

Notice the Index resolver filters out some non-transit data https://github.com/fulcrologic/fulcro-rad-demo/pull/18

hadils17:02:01

I resolved my problem. Thanks everyone! I started from the RAD demo and carefully integrated the native stuff.

stuartrexking20:02:14

I’m looking for a little guidance on authorization of various parts of my app (non-RAD). I have an authentication flow and UISM similar to what RAD provides that allows for auth using AWS Cognito. I have a set of user permissions in my state. What I’m unclear on is where is the best layer in the app to enforce authorization. I have simple router hierarchy. Some things I’d like to be able achieve: 1. Have a authenticated and non-authenticated authorized routes 2. Have authorization on particular components, say comparing the user permissions to the set of permissions on the components 3. Perhaps even have authorization on the query. RAD provides a few hints of authorization against attributes but purposely avoids an implementation as it’s a minefield. At this state all front end. I’ll sort parser security at a later stage. What I’m looking for is a little guidance on which hooks in the system to use. For this kind of functionality should I be using allow-route-change? on the routes? Should I build an authorizing router that can wrap other components? Should I be using render-middleware? Should I just have a defsc or function that can do this for me? I want to keep the simplicity and performance that fulcro provides. I’m a little lost and would love a push in a particular direction, perhaps even a strong shove! Where to begin or how have others done it?

stuartrexking22:02:01

I’m thinking that I should just take the RAD approach: Have a Session component that queries on the authentication state as well as the user permissions, then just use those directly in components that require them.