Hello everybody. I’m currently upgrading from prisma1 to prisma2(prisma-binding to sdl-first approach).
I’ve got some questions regarding schemas.
In order to use prisma1 as well as prisma2 we need at least 2 schemas: datamodel(define types that map to the database tables) and application schema(what clients can query from the API, in my setup it’s fed to the ApolloServer)
It’s assumed in the upgrade tutorials that an app schema is defined through importing types from prisma service(generated). I’ve got a prisma1 setup(wasn’t written by me) which uses:
• datamodel schema
• full schema(downloaded from the graphql playground, it’s used to generate some fragments, not to extend an app schema with some type definitions)
• application schema(written manually without any imports) .
Also there is a lot going on in the code, some custom attributes, manipulations with the schema, replacements, etc.
I plan to do the following and wanted to ask if this is the right direction to get at least a basic functionality ?
1. Migrate my prisma2 schema to the DB. I used dev DB that was created by the prisma1 datamodel to create prisma2 schema. Now I want to create a new DB based on the prisma2 datamodel and rerun all tests against it later.
2. Refactor all the resolvers to use prisma2 client, then check with tests.
Cannot quite understand why do I need to download full schema from the graphql playground? Where it fits ?
Thank you.