Use with Apollo Server and comparison to other tools #2076
-
What's the recommended / possible ways to use Prisma with Apollo Server?
How does it compare to SQLDataSource and join-monster? Does Primsa do:
What does Prisma do that the other things don't do? For instance:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I will let the devs comment on this one (also interested), but I can share a bit what I have been doing with Apollo.
If you read the doc, you will see that migrations are a work in progress. The studio is also experimental at this point but on the roadmap. The no-SQL DB on the roadmap too, but IMO all you probably need is postgres with a JSON column (I dislike NoSQL very much). |
Beta Was this translation helpful? Give feedback.
-
Hey Loren, here are some brief answers to your points. I'll try to elaborate a bit later since I currently have don't have too much time but want to provide the Gist already. Also happy to jump on a call with you to discuss this further! We also have a dedicated page about Prisma and GraphQL in the docs: https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/graphql
You'd use Prisma the same way as any other DB access library (e.g. ORMs like Sequelize or SQL query builders like knex): Prisma Client is your interface to the database and is used inside of your GraphQL resolvers to send DB queries. We have examples for what this can look like here:
That's not supported with Prisma 2, see here: https://www.prisma.io/docs/more/faq#does-prisma-client-support-graphql-schema-delegation-and-graphql-binding
I'm not familiar enough with Apollo Data Sources but I believe this would be possible (but would require that someone actually builds drop-in Prisma Data Source for Apollo?).
I guess that's the way indeed.
I don't have much experience with these unfortunately either, but we recently employed some "data loader" optimizations in Prisma Client. Maybe @timsuchanek can speak to this a bit?
Yes, Prisma Migrate is available as well when using Prisma Client (since both are based on the Prisma schema). Note however that it's currently considered experimental and therefore shouldn't be used in production apps yet.
Yes, viewing and editing data in Prisma Studio is awesome! It supports a "table" and a "tree" view. The tree view is especially nice to drill into deeply nested data. You can get an overview here: https://prisma-studio.now.sh/
Yes, in the future Prisma will support non-SQL DBs and it's also on our roadmap to figure out how to join data across different DBs! One more note: Our Prisma Labs team is currently working on Nexus: https://www.nexusjs.org/#/ Nexus is a framework for building code-first GraphQL APIs. It's not opinionated on the HTTP layer, so you can also use it together with Apollo Server. Hope that helps for now, let me know if you have further questions! |
Beta Was this translation helpful? Give feedback.
-
Some quick info from @schickling regarding the data loader questions:
|
Beta Was this translation helpful? Give feedback.
Hey Loren, here are some brief answers to your points. I'll try to elaborate a bit later since I currently have don't have too much time but want to provide the Gist already. Also happy to jump on a call with you to discuss this further!
We also have a dedicated page about Prisma and GraphQL in the docs: https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/graphql
You'd use Prisma the same way as any other DB access library (e.g. ORMs like Sequelize or SQL query builders like knex): Prisma Client is your interface to the database and is used inside of your GraphQL resolvers to send DB queries.
We have …