I've been teaching myself GraphQL using Prisma -- very much a beginner at both.
I just got a programming test where the brief is to connect a React Native frontend to a WordPress backend. I thought this might be a fun opportunity to put some Prisma and GraphQL into practice. My thought was to connect Prisma to the WP MySQL DB and then use Prisma-GraphQL to connect to React Native.
However, it seems that connecting Prisma to MySQL isn't so straightforward -- at least for me, a beginner. I'd welcome any info as to how one might go about this -- not detailed code, of course, but more whether it's reasonable to do what I'm thinking of, and what packages/route would be the best way forward. Thanks!
An easy answer would be: All you need to connect Prisma to any MySQL database is a Host and a port(3306 because this is MYSQL) of where the DB is running.
And this leads us to where do you have your Prisma Server running?
if you are just a front-end dev and you don't know or don't wanna deal with stuff like docker then you better off using something like Prisma Cloud which will provision a Prisma server for you and can also host the MySQL Database for you or you can host it yourself and choose the have an existing database option and provide the hostname(URL) where you have it during creating your Prisma server.
on the other hand, if you comfortable running it locally or on a cloud provider with Docker(Local Prisma Setup) then you just provide the host and port as you can see in the docs link above in your docker-compose configuration file to Prism.
update: Regard connecting to an existing DB, If you tried to do a
prisma deploy
on a DB with a different schema it probably gonna blow and complain about the schema conflict, that's why you need introspection for before but as you mentioned in the comment it's only for PostgreSQL at the moment, they are working on creating a tool for MySQL but it's no one knows when it could be out you can check for updates on the open issue with this feature here
hope this can help simplify things a bit.