Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Build declaratively back ends and APIs with GraphQL or REST (github.com/metatypedev)
48 points by chvogt16 on Aug 12, 2023 | hide | past | favorite | 11 comments


This promises the world but I had to work hard to find a code example, and even then I didn’t really “get” what the library will do for me in practice.

EDIT: after the pointer to the use cases in the thread below, I think I get it now! This seems like a great idea. Similar to Trustfall (rust) and GraphQLCompiler (Python).

I would be interested in using it if it was Typescript instead of Python. Still very cool how things snap together.


There is a whole section with use cases and code examples on the website (crud, backend for frontend, function-as-a-service, iam provider and more): https://metatype.dev/use-cases/automatic-crud-validation


In the example provided, the code uses Prisma. Am I missing something?


Prisma is one of the runtime currently supported [1]. Metatype enables you to compose multiple runtimes together. Let's say you have model/struct product (id, name, similarProducts), the two first attributes may be stored in Prisma (like you would do it normally), the third one can come from another runtime such as an HTTP api and the engine will take care of resolving the data together. You can also add an authorization policy on any of the fields.

[^1] https://metatype.dev/docs/reference/runtimes


This is nicely done. I like your marketing. I made it 98% of the way through reading your website, I was almost convinced. Then, I ran into a couple of typos right at the very end, that instead led to me writing you this comment on HN.


There’s a typo in the HN title: “declaratively back ends”


yeah, I judged it poorly starting at the title


Thanks for the feedback, we are non-english speakers trying our best. Will review them soon.


As a non-native English speakers myself, ChatGPT has been a valuable tool. It's not about the small typos and errors (which tools like Grammarly could help), it's about the tone and everything.


This is great work! I just worked on something very similar and it was extremely powerful.

I'm looking forward to setting aside some time to read the code. I'm particularly interested in how you approached API evolution and backwards compatibility.

Do you have any plans to start a company around this?


For now, we mostly focus on building solid foundations and having a design that can be easily extended by the users. It is already run in production at some local companies and we will see whether this is more adoptions in the next months.

Regarding backwards compatibility, we believe that GraphQL's approach is kind of incomplete and that more guarantees can be provided by the server. Nothing concrete yet, but happy to exchange a few ideas!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: