Hacker News new | ask | show | jobs
by ta3411 1296 days ago
I am loving Hasura so far. However, I am getting stuck with how to best write custom logic on top of this. For example: I have a products table, which Hasura will automatically generate schema for. But now I want to do a custom getProducts GraphQL query to do more advanced filtering (search, sort, ranking etc). What I end up doing it to have a remote schema. And now my clients need to understand two different product types (one generated by Hasura, and one generated by my custom remote schema. Do you have any advice on how to best resolve this?

On top of that, do you typically parse these Hasura Apollo into your client models? Or do you use the fragments directly in UI code since it already support types.

1 comments

Hm…ideally your remote schema can return one or more product ids and then you can create a relationship back to the model from Postgres.

Link to docs: https://hasura.io/docs/latest/remote-schemas/remote-relation...