-
-
Notifications
You must be signed in to change notification settings - Fork 676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with Prisma #217
Comments
I should add, being able to control the schema via code would also allow for up/down migrations to be coded. While its possible todo this today it would mean creating yet another instance of the schema in another language to be able to manipulate it. |
This is a killer feature that would really drive adoption of type-graphq via the Prisma community. Prisma's generator uses the SDL as the source of truth and requires manual copy/paste to keep everything in sync. If type-graphql could be used instead, I imagine it would be the goto solution for Prisma users. |
@bmayen I will look where this approach will lead us and if there is a gap, I will for sure try to fill it with decorators 😉 |
Might make sense for Nexus to support decorators natively. Opened an issue there to see what their thoughts are. |
Hi @19majkel94! We're still very interested in supporting you with a seamless Prisma integration. Given the very nature of developers, there will always be some opinionated preferences and we're trying to work with framework authors like you to fit Prisma as well as possible into your API design and ecosystem. We're currently working towards Prisma 2 which will also include the Here's an idea how the API could look like: @ObjectType
@Prisma({
model: 'Product',
pick: ['id', 'name', 'type', 'brand', 'variants'],
})
export class Product {
@Field
options(args?: { showAll?: boolean }): Promise<Option[]> {
return this.ctx.prisma.options()
}
@Mutation({ name: "setProductPrice" })
setPrice(price: number) {
// ...
}
} |
That's great! SDK with programmatical way to register Prisma types and generate client, etc. would be great, as printing a Wrapping/hiding this under the decorator-based API is the simplest thing to do 😉 Can't wait to try the alpha/beta of the SDK! |
Great news indeed. I am currently prototyping an extendable framework and I want prisma to be a prime citizen. Also considering type-graph and maybe nexus as plugin schema definition providers. Would really appreciate at least a generic idea of when would this be possible to plan my roadmap accordingly. Thanks. |
+100 Really looking forward to this. I think we shouldn't need Generating GraphQL types is OK and a necessity in the near future. |
Looking forward to TypeGraphQL integration with Prisma. 👀 I don't like the Nexus syntax. The first preview of Prisma 2 is out. But I don’t understand how all that will fit and work together.
My final goal is to get the full OpenCRUD GraphQL API. Will it possible to define the data model using TypeGraphQL's classes and decorators instead of Prisma format? |
My company is very excited to try out the type-graphql/prisma 2 integration. When can we expect this to be available? @19majkel94 |
@sarthakagrawal |
@19majkel94 What about my questions? |
|
Any news on this one? Really don't like nexus syntax and would love to see this in action! :) |
I have a working basic integration on a private repo 💪 Waiting for feedback from Prisma team and for some changes in the Prisma generator API to make it easier work on non-UNIX OSes 😉 |
Sounds excellent. I'm early on in a project (prototyping) so hit me up if you need some testing done. Also, if we can poke a GitHub issue to aid you getting some feedback, let us know :) p.s Thanks for your hard work. |
The preview of the integration is now publicly available 🎉 https://twitter.com/MichalLytek/status/1199708285622005761 Closing this issue in favor of #476 to indicate that only the new Prisma Framework (Prisma 2) will be supported 🔒 |
Originally posted by @ntziolis in #77 (comment)
The text was updated successfully, but these errors were encountered: