Hello, unfortunately the registration in the forum...
# orm-help
j
Hello, unfortunately the registration in the forum does not work at the moment, therefore I write my question here (hope that's okay). I would like to automatically create the GraphQL schema for an existing database with existing data. I already did a lot of research and found that this should be possible with PostgreSQL. I tried that, but unfortunately I only get the tables generated as a schema and nothing else. The generated GraphQL schema then consists only of the table names and their attributes, but there are no operations and so on. I found a generated schema on Github: https://gist.github.com/sorenbs/0861e1f404981012f160b940b6cf41ea/ That's exactly the kind of schema I would like to have generated (based on my database, of course) Can someone please tell me if and how this is possible with Prisma? Many thanks in advance!
m
The generated GraphQL schema is what we call a data model. You must deploy this data model then to your Prisma server by running
prisma deploy
. The server will then expose a schema that is like the one you linked in the Gist.
Have a look at this tutorial to learn more about our basic workflow: https://docs-beta.prisma.io/1.13/get-started/01-setting-up-prisma-demo-server-a001/
j
Alright, got it working! Thank you very much for quick answer.
m
👍