It appears datamodel.prisma and schema.graphql ove...
# orm-help
b
It appears datamodel.prisma and schema.graphql overlap quite a bit but they have different purposes. Every software dev's DRY radar is of course on fire about keeping two representations of the same data ( even if used for different purposes ) in sync. I thought I found a feature to import schemas into datamodel based on the statement from a similar question ( link below ). Can anyone confirm that this statement will work and help me locate it in the docs? I can't locate it .... # import User, Note from './datamodel.generated.graphql' https://www.prisma.io/forum/t/graphcool-1-0-datamodel-graphql-vs-schema-graphql/2063/2
that’s the doc link for graphql-import
but your “import schemas into datamodel” comment sounds backwards to me
you’ll see types in a schema file that closely mirror types in a datamodel, but there’s one or two fields left out in the schema file
👍 1
those are the public-facing bits
you want to store a password with your User model, but you don’t want to allow a client to query for it. so you override the imported, datamodel-defined User type with a definition in your schema file
@wesbos covers this pretty well in video 14 of his advanced react course