To add to <@UJEABQSTA> ‘s question, does 1) your d...
# orm-help
j
To add to @Noah ‘s question, does 1) your data model and 2) the outward facing API have to be identical? If not, why are they different?
n
^ this. Isn’t the datamodel a subset of the schema? Sure, in the datamodel you keep relations, unique, id, default, etc. but can’t the schema just import the datamodel and ignore the “@“s?
n
No, the datamodel is not a subset of the schema. In your public API schema, you can import types from the generated prisma schema, e.g.:
Copy code
# import User from "./generated/prisma.graphql"
but many times you wouldn't want to do that, because you don't want to expose the User's password/secret on your public facing API (even encrypted) and you could need computed properties on public API that are not on the datamodel (e.g. number of followers).