4 ms·
It's been interesting watching Prisma, formerly Graphcool, transition from backend-as-a-service to open source backend to client ORM library. They also use blee
by welder 8y ago
It's been interesting watching Prisma, formerly Graphcool, transition from backend-as-a-service to open source backend to client ORM library. They also use bleeding edge patterns, so I always know where to go for examples as stuff gets adopted mainstream :) Keep up the good work Prisma team!
Question specific to this autogenerated client: does that mean I have to bump client version numbers every time my backend schema changes? Does this help if I'm building a backwards-compatible api, like Stripe's API [1]? Apologies if this is already answered in your docs.
[1]: https://stripe.com/blog/api-versioning https://stripe.com/blog/api-versioning
- c036 8y agoBecause the schema is updated on the Prisma server, I do think it could be possible to have multiple Prisma server running with different schema version. The only issue that we did encounter so far is that it doesn't know play well easily when you have more than one instance of a Prisma server behind a load balancer that your backend connect to.
- jhalstead 8y ago> They also use bleeding edge patterns, so I always know where to go for examples as stuff gets adopted mainstream :) Do you have specific examples of cutting edge patterns they use that you can share? I'm always interested in seeing concrete examples of (often) abstract patterns/concepts.
- deleted 8y ago[deleted]
- hokumguru 8y agoYou've hit a GraphQL specific issue with APIs. Generally I think the best practice is to only make additive changes to your API and deprecate as necessary. GraphQL apis don't necessarily need versioning as the requests as it's much easier to continuously update them. https://graphql.org/learn/best-practices/ https://graphql.org/learn/best-practices/
- nikolasburk 8y ago(I work at Prisma) Thanks a lot for the positive feedback, we appreciate it a lot! As to your question, I assume with "backend schema" you're talking about the Prisma datamodel? Whenever you change the datamodel, you're also re-generating your Prisma client. So, it can definitely make sense to version your Prisma client as your datamodel changes. Does this clear it up? The main purpose of the code generation really is to have proper typings for all database operations based on the datamodel. For example, if you're adding a new model type to the datamodel, Prisma doesn't only generate according models in your programming language, it also generates types that facilitate filtering, pagination, ordering and any other operations of your database.