Greetings all :slightly_smiling_face: I am experim...
# orm-help
d
Greetings all 🙂 I am experimenting with SQL Server and Prisma using the preview connector. I was able to follow the tutorial and introspect the db and generate... All is well there. Now I want to use that connection as part of docker-compose (
prismagraphql/prisma:1.34
image) so I can use the playground with SQL Server, but it fails for
unknown connector
when running
docker-compose up -d
(I tried 'sqlserver'). Is this supported, and if not, does anyone know of a way to create a GraphQL playground?
n
Hey Drew 👋 the Docker image you used is only available for Prisma 1. The tutorial you followed (this one?) is for Prisma 2. Prisma 2 does not have a native GraphQL layer any more, it's "just an ORM" where you can build your own GraphQL server on top. Here is an example project that shows how to build a GraphQL server with Prisma 2: https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql
Also, can I ask what gave you the expectation to get a GraphQL Playground with Prisma? We often see folks with this kind of misconception and are trying to combat this by updating the resources that people find online that give them this impression 🙂
d
Cool! That is helpful. Yes - I was following the "starting from scratch" tutorial. I recently completed a Udemy course for GraphQL that used Prisma 1, and the docker image I was referring to spun up its own playground. I guess my trouble is being new and not yet knowing where the lines are drawn between GraphQL and Prisma.
👍 1
💡 1
n
I see! Yeah, I totally get that – we often see newcomers being confused when they found some Prisma 1 resource online and then get in touch with Prisma 2. The main difference really is that Prisma 2 doesn't use GraphQL at all, it's purely a JavaScript/TypeScript library that lets you access your database. (No Docker and no Prisma proxy server for your DB are required any more.)
Maybe this page also gives some more context about this: https://www.prisma.io/graphql
d
Thank you. You are very helpful! Given this, I think I will try to stand up a GraphQL Yoga app (or something) that uses the generated Prisma Client to do the querying / mutating / subscribing against my SQL Server instance.
n
Yes, this is exactly how to do it 🙂 the
prisma-examples
repo has a lot of different examples for GraphQL servers with different libraries (Apollo Server, NestJS, Nexus, TypeGraphQL, ...), so might be worth checking that out: https://github.com/prisma/prisma-examples/ 🙌
If you're looking for a more comprehensive tutorial, you can follow this one on How to GraphQL: https://www.howtographql.com/graphql-js/0-introduction/
🙌 1
d
Thank you!