3 ms·
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: a
by jitl 3y ago
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.
- zifeo 3y agoThere 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 https://metatype.dev/use-cases/automatic-crud-validation
- awb 3y agoIn the example provided, the code uses Prisma. Am I missing something?
- zifeo 3y agoPrisma 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 https://metatype.dev/docs/reference/runtimes