Hacker News new | ask | show | jobs
by tangkikodo 750 days ago
I would like to recommend pydantic-resolve, it can enjoy benefits from botn rest/rpc and gql.

the triky part of gql is we need to build a Query system for all business requirement in single entry, and we can not predict what query will be issued by client.

this is anti-pattern because presenter layer should not care about how data is composed.

It would be much easy if we treat each rest/rpc endpoint as a GQL entry, use resolver and dataloader to quickly & easily build complicated view data, everything is still under the control of backend.

here is a demo. https://github.com/allmonday/pydantic-resolve/blob/master/ex...