graphql

Kodinak 2025-03-01T12:06:50.325669Z

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

emccue 2025-03-05T01:48:41.847399Z

well - apollo graphql is pretty well maintained

emccue 2025-03-05T01:49:15.341709Z

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

emccue 2025-03-05T01:49:18.297329Z

embrace interop

👍 1
Kodinak 2025-03-05T09:32:57.047399Z

Thanks, leaning that way

2025-03-01T12:10:09.040799Z

(Lacinia is fine. But it is a GraphQL server, not a client.)

Kodinak 2025-03-01T12:12:03.557199Z

THanks, didn't notice that. Looks like it's not an option on the front-end then. What about for client?

2025-03-01T12:28:22.842859Z

Do you need a GraphQL client library?

Kodinak 2025-03-01T12:31:33.739959Z

I'm thinking it would be good. Kinda like re-graph but active.

2025-04-15T14:23:15.100799Z

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

👍 1
2025-04-15T14:24:45.925339Z

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

Kodinak 2025-04-15T14:52:03.425449Z

Thanks, will try that

2025-04-15T14:56:53.965699Z

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

Kodinak 2025-04-15T14:58:44.689889Z

Interesting. For now, I opted for a third party ( Hassura/Postgraphile). Haven't yet settled on client

2025-04-15T14:58:49.900809Z

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

emccue 2025-04-15T15:00:10.233769Z

You mean hasura?

emccue 2025-04-15T15:00:25.167059Z

and what is postgraphile?

emccue 2025-04-15T15:00:48.659519Z

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)

2025-04-15T15:01:23.032319Z

whats new in the v3? I was always really curious about hasura but never tried

emccue 2025-04-15T15:01:59.377609Z

Whats new is that their focus as a company turned to "we are an AI company now, something something microservices"

emccue 2025-04-15T15:02:16.503309Z

and features that are crucial to how our system works (like event triggers) are just gone

emccue 2025-04-15T15:02:33.882419Z

"data access layer fart noises"

Kodinak 2025-04-15T15:02:34.829169Z

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

emccue 2025-04-15T15:03:21.925439Z

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"

emccue 2025-04-15T15:04:21.375209Z

and it makes what would otherwise be huge insane queries very easy to edit + create

emccue 2025-04-15T15:04:37.302039Z

SQL really does suck at "I want this whole denormalized tree of data"

emccue 2025-04-15T15:05:02.087719Z

hasura turns basically any query into a single SQL query

2025-04-15T15:05:11.066259Z

yea

Kodinak 2025-04-15T15:05:11.998889Z

I kinda tried kong -> keycloak -> Hasura -> Postgres. Many papercuts, but that's what I started with

2025-04-15T15:05:14.479829Z

that’s cool

2025-04-15T15:05:30.351899Z

IMO the FE state management is almost harder

emccue 2025-04-15T15:05:56.606689Z

Let me know how postgraphile goes

emccue 2025-04-15T15:06:18.459059Z

Like I alluded, hasura is awesome but I have zero confidence that the company will survive the inevitable bubble pop

emccue 2025-04-15T15:06:35.689149Z

and i'd like to continue to write software in the same way it allows later on in my career

2025-04-15T15:07:28.007399Z

“PromptQL” oh no

emccue 2025-04-15T15:07:48.886749Z

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"

emccue 2025-04-15T15:07:55.068789Z

yeah - see what I mean?