Kinda rookie question ... I'm trying to decide on a way to access graphql APIs from cljs + reactnative app. I'm conflicted about libraries and current state of things in this regard. re-graph? lacinia? Custom apollo wrapper (or some such interop)? I don't know. My concern about the former two is level of maintenance. Last commits seem to be old. Or is that not a concern? P.S: Turns out Lacina is not an option since it's on the server side
well - apollo graphql is pretty well maintained
i know its not a clojure library but its pretty well maintained and, as long as you are using helix and therefore have easy access to hooks, it should be fine
embrace interop
Thanks, leaning that way
(Lacinia is fine. But it is a GraphQL server, not a client.)
THanks, didn't notice that. Looks like it's not an option on the front-end then. What about for client?
Do you need a GraphQL client library?
I'm thinking it would be good. Kinda like re-graph but active.
This kinda comes down to how much state management you want to have on the client. Apollo maintains a normalized cache of records based on identity (usually ID), which allows for various types of state management wrt mutations
If you don’t need or want to concern with state changes in response to mutations, you can simplify things considerably by just making vanilla requests at the gql server, and this is the model being recommended in next.js server components
Thanks, will try that
Believe it or not, Apollo requires you to call refetchQueries() in some situations where you as the developer are declaring the dependencies between queries. In a lot of cases there’s no way to automatically derive this graph between frontend and backend
Interesting. For now, I opted for a third party ( Hassura/Postgraphile). Haven't yet settled on client
for example a mutation may require that another query’s count value is updated, that can be accomplished by modifying the record in the mutation result, or by manually refetching the related queries in response handling
You mean hasura?
and what is postgraphile?
we built our current prod app with hasura - its actually really cool (even if their "v3/v2" whatever they call their new product sucks ass)
whats new in the v3? I was always really curious about hasura but never tried
Whats new is that their focus as a company turned to "we are an AI company now, something something microservices"
and features that are crucial to how our system works (like event triggers) are just gone
"data access layer fart noises"
Yes, Hasura. I had some challenge integrating it in the backend ecosystem, so I am trying https://www.graphile.org/postgraphile/. This is all evolving. Still experimenting
its really just cool because you can expose a table or a view with permissioning + it gives you the bare minimum needed for "on insert, do X" and "when this mutation, do Y"
and it makes what would otherwise be huge insane queries very easy to edit + create
SQL really does suck at "I want this whole denormalized tree of data"
hasura turns basically any query into a single SQL query
yea
I kinda tried kong -> keycloak -> Hasura -> Postgres. Many papercuts, but that's what I started with
that’s cool
IMO the FE state management is almost harder
Let me know how postgraphile goes
Like I alluded, hasura is awesome but I have zero confidence that the company will survive the inevitable bubble pop
and i'd like to continue to write software in the same way it allows later on in my career
“PromptQL” oh no
oh the other thing it does is row level filtering of like "you can only see this row if you are a member of the team for which this payable is associated and on that team you have this permission"
yeah - see what I mean?